类 ResourceFilePool
- java.lang.Object
-
- proguard.resources.file.ResourceFilePool
-
- 所有已实现的接口:
FilePool
public class ResourceFilePool extends java.lang.Object implements FilePool
This is a set ofResourceFileinstances. They can be enumerated or retrieved by name. They can also be accessed by means of resource file visitors.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected java.util.Map<java.lang.String,ResourceFile>resourceFileMap
-
构造器概要
构造器 构造器 说明 ResourceFilePool()Creates a new empty ResourceFilePool.ResourceFilePool(java.lang.Iterable<? extends ResourceFile> resourceFiles)Creates a new ResourceFilePool with the given resource files.ResourceFilePool(ResourceFile... resourceFiles)Creates a new ResourceFilePool with the given resource files.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddResourceFile(java.lang.String fileName, ResourceFile resourceFile)Adds the given ResourceFile with the given name to this pool.voidaddResourceFile(ResourceFile resourceFile)Adds the given ResourceFile to this pool.voidclear()Clears the pool.ResourceFilegetResourceFile(java.lang.String fileName)Returns a ResourceFile from this pool, based on its name.ResourceFilePoolrefreshedCopy()Returns a ResourceFilePool with the same resource files, but with the keys that correspond to the names of the resource file instances.voidremoveResourceFile(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.voidresourceFilesAccept(java.lang.String fileNameFilter, ResourceFileVisitor resourceFileVisitor)Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.voidresourceFilesAccept(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.voidresourceFilesAccept(ResourceFileVisitor resourceFileVisitor)Applies the given ResourceFileVisitor to all instances in this pool.voidresourceFilesAccept(StringMatcher fileNameFilter, ResourceFileVisitor resourceFileVisitor)Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.intsize()Returns the number of resource files in this pool.java.lang.StringtoString()-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 proguard.resources.file.FilePool
resourceFileAccept
-
-
-
-
字段详细资料
-
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. Returnsnullif 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(ResourceFileVisitor resourceFileVisitor)
Applies the given ResourceFileVisitor to all instances in this pool.- 指定者:
resourceFilesAccept在接口中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
-
-