类 ResourceFilePool

  • 所有已实现的接口:
    FilePool

    public class ResourceFilePool
    extends java.lang.Object
    implements FilePool
    This is a set of ResourceFile instances. They can be enumerated or retrieved by name. They can also be accessed by means of resource file visitors.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void addResourceFile​(java.lang.String fileName, ResourceFile resourceFile)
      Adds the given ResourceFile with the given name to this pool.
      void addResourceFile​(ResourceFile resourceFile)
      Adds the given ResourceFile to this pool.
      void clear()
      Clears the pool.
      ResourceFile getResourceFile​(java.lang.String fileName)
      Returns a ResourceFile from this pool, based on its name.
      ResourceFilePool refreshedCopy()
      Returns a ResourceFilePool with the same resource files, but with the keys that correspond to the names of the resource file instances.
      void removeResourceFile​(java.lang.String fileName)
      Removes the specified ResourceFile from this pool.
      java.util.Set<java.lang.String> resourceFileNames()
      Returns a Set of all resource file names in this resource file pool.
      void resourceFilesAccept​(java.lang.String fileNameFilter, ResourceFileVisitor resourceFileVisitor)
      Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.
      void resourceFilesAccept​(java.util.List<java.lang.String> fileNameFilter, ResourceFileVisitor resourceFileVisitor)
      Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filters.
      void resourceFilesAccept​(ResourceFileVisitor resourceFileVisitor)
      Applies the given ResourceFileVisitor to all instances in this pool.
      void resourceFilesAccept​(StringMatcher fileNameFilter, ResourceFileVisitor resourceFileVisitor)
      Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.
      int size()
      Returns the number of resource files in this pool.
      java.lang.String toString()  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • resourceFileMap

        protected final java.util.Map<java.lang.String,​ResourceFile> resourceFileMap
    • 构造器详细资料

      • ResourceFilePool

        public ResourceFilePool()
        Creates a new empty ResourceFilePool.
      • ResourceFilePool

        public ResourceFilePool​(ResourceFile... resourceFiles)
        Creates a new ResourceFilePool with the given resource files.
        参数:
        resourceFiles - the resource files to be added.
      • ResourceFilePool

        public ResourceFilePool​(java.lang.Iterable<? extends ResourceFile> resourceFiles)
        Creates a new ResourceFilePool with the given resource files.
        参数:
        resourceFiles - the resource files to be added.
    • 方法详细资料

      • clear

        public void clear()
        Clears the pool.
      • addResourceFile

        public void addResourceFile​(ResourceFile resourceFile)
        Adds the given ResourceFile to this pool.
      • addResourceFile

        public void addResourceFile​(java.lang.String fileName,
                                    ResourceFile resourceFile)
        Adds the given ResourceFile with the given name to this pool.
      • removeResourceFile

        public void removeResourceFile​(java.lang.String fileName)
        Removes the specified ResourceFile from this pool.
      • getResourceFile

        public ResourceFile getResourceFile​(java.lang.String fileName)
        Returns a ResourceFile from this pool, based on its name. Returns null if the instance with the given name is not in the pool.
        指定者:
        getResourceFile 在接口中 FilePool
      • size

        public int size()
        Returns the number of resource files in this pool.
      • refreshedCopy

        public ResourceFilePool refreshedCopy()
        Returns a ResourceFilePool with the same resource files, but with the keys that correspond to the names of the resource file instances. This can be useful to create a resource file pool with obfuscated names.
      • resourceFileNames

        public java.util.Set<java.lang.String> resourceFileNames()
        Returns a Set of all resource file names in this resource file pool.
        指定者:
        resourceFileNames 在接口中 FilePool
      • resourceFilesAccept

        public void resourceFilesAccept​(java.lang.String fileNameFilter,
                                        ResourceFileVisitor resourceFileVisitor)
        Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.
        指定者:
        resourceFilesAccept 在接口中 FilePool
      • resourceFilesAccept

        public void resourceFilesAccept​(java.util.List<java.lang.String> fileNameFilter,
                                        ResourceFileVisitor resourceFileVisitor)
        Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filters.
        指定者:
        resourceFilesAccept 在接口中 FilePool
      • resourceFilesAccept

        public void resourceFilesAccept​(StringMatcher fileNameFilter,
                                        ResourceFileVisitor resourceFileVisitor)
        Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.
        指定者:
        resourceFilesAccept 在接口中 FilePool
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object