Package digilib.io

Class DocuDirCache

    • Constructor Detail

      • DocuDirCache

        public DocuDirCache​(FileOps.FileClass fc,
                            DigilibConfiguration dlConfig)
        Constructor with digilib configuration and file class.
        Parameters:
        fc - the FileClass
        dlConfig - the DigilibConfiguration
      • DocuDirCache

        public DocuDirCache()
        Default constructor. Uses FileClass.IMAGE.
    • Method Detail

      • size

        public int size()
        The number of directories in the cache.
        Returns:
        the size
      • put

        public DocuDirectory put​(DocuDirectory newdir)
        Add a DocuDirectory to the cache. Always returns the correct Object from the cache, either newdir one or another one.
        Parameters:
        newdir - the DocuDirectory
        Returns:
        dir the DocuDirectory
      • putDir

        public DocuDirectory putDir​(DocuDirectory newDir)
        Add a directory to the cache and check its parents. Always returns the correct Object from the cache, either newDir or the cached one.
        Parameters:
        newDir - the DocuDirectory
        Returns:
        the DocuDirectory
      • getFile

        public DocuDirent getFile​(String fn,
                                  int in,
                                  FileOps.FileClass fc)
        Deprecated.
        Returns the DocuDirent with the pathname fn and the index in of FileClass fc. If fn is a file then the corresponding DocuDirent is returned and the index is ignored.
        Parameters:
        fn - digilib pathname
        in - file index
        fc - file class
        Returns:
        the DocuDirent
      • getFile

        public DocuDirent getFile​(String fn,
                                  int pn)
        Returns the DocuDirent with the pathname fn and the index in. If fn represents a file then the corresponding DocuDirent is returned and the number is ignored.
        Parameters:
        fn - digilib pathname
        pn - file number
        Returns:
        the DocuDirent
      • getDirectory

        public DocuDirectory getDirectory​(String fn)
        Returns the DocuDirectory indicated by the pathname fn. If fn represents a file then its parent directory is returned.
        Parameters:
        fn - digilib pathname
        Returns:
        the DocuDirectory
      • getNumFiles

        public int getNumFiles()
        Returns:
        long the num files
      • getHits

        public int getHits()
        Returns:
        long the hits
      • getMisses

        public int getMisses()
        Returns:
        long the misses
      • setFileClass

        public void setFileClass​(FileOps.FileClass fileClass)
        Parameters:
        fileClass - the FileClass