<filename>pycache/BaseCache.py
# Copyright 2017 <NAME>
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

from abc import ABCMeta, abstractmethod

class Cache(metaclass=ABCMeta):
    def __init__(self, cachesize):
        self.cachesize = cachesize

    @abstractmethod
    def ispresent(self, key):
        """
        This method has to be implemented by subclass
        :param key: Key of Cacheable Object
        :return: If key is present in cache or not
        """
        pass

    @abstractmethod
    def insert_into_cache(self, object):
        """
        This method has to be implemented by subclass
        :param object: Object
        :return:
        """
        pass

    @abstractmethod
    def delete_from_cache(self, key):
        """
        This method has to be implemented by subclass
        :param key: Delete the following key and corresponding object from cache
        :return:
        """
        pass

    @abstractmethod
    def get_from_cache(self,key):
        """
        Get object from cache for specified cache
        :param key:
        :return:
        """
        pass



<filename>pycache/BaseCache.py
# Copyright 2017 <NAME>
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

from abc import ABCMeta, abstractmethod

class Cache(metaclass=ABCMeta):
    def __init__(self, cachesize):
        self.cachesize = cachesize

    @abstractmethod
    def ispresent(self, key):
        """
        This method has to be implemented by subclass
        :param key: Key of Cacheable Object
        :return: If key is present in cache or not
        """
        pass

    @abstractmethod
    def insert_into_cache(self, object):
        """
        This method has to be implemented by subclass
        :param object: Object
        :return:
        """
        pass

    @abstractmethod
    def delete_from_cache(self, key):
        """
        This method has to be implemented by subclass
        :param key: Delete the following key and corresponding object from cache
        :return:
        """
        pass

    @abstractmethod
    def get_from_cache(self,key):
        """
        Get object from cache for specified cache
        :param key:
        :return:
        """
        pass



# Copyright 2017 <NAME> # #    Licensed under the Apache License, Version 2.0 (the "License"); #    you may not use this file except in compliance with the License. #    You may obtain a copy of the License at # #        http://www.apache.org/licenses/LICENSE-2.0 # #    Unless required by applicable law or agreed to in writing, software #    distributed under the License is distributed on an "AS IS" BASIS, #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #    See the License for the specific language governing permissions and #    limitations under the License. This method has to be implemented by subclass         :param key: Key of Cacheable Object         :return: If key is present in cache or not This method has to be implemented by subclass         :param object: Object         :return: This method has to be implemented by subclass         :param key: Delete the following key and corresponding object from cache         :return: Get object from cache for specified cache         :param key:         :return: