Package proguard.resources.file
Class ResourceFilePool
java.lang.Object
proguard.resources.file.ResourceFilePool
- All Implemented Interfaces:
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty ResourceFilePool.ResourceFilePool(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResourceFile(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.getResourceFile(String fileName) Returns a ResourceFile from this pool, based on its name.Returns a ResourceFilePool with the same resource files, but with the keys that correspond to the names of the resource file instances.voidremoveResourceFile(String fileName) Removes the specified ResourceFile from this pool.Returns a Set of all resource file names in this resource file pool.voidresourceFilesAccept(String fileNameFilter, ResourceFileVisitor resourceFileVisitor) Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.voidresourceFilesAccept(List<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.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface proguard.resources.file.FilePool
resourceFileAccept
-
Field Details
-
resourceFileMap
-
-
Constructor Details
-
ResourceFilePool
public ResourceFilePool()Creates a new empty ResourceFilePool. -
ResourceFilePool
Creates a new ResourceFilePool with the given resource files.- Parameters:
resourceFiles- the resource files to be added.
-
ResourceFilePool
Creates a new ResourceFilePool with the given resource files.- Parameters:
resourceFiles- the resource files to be added.
-
-
Method Details
-
clear
public void clear()Clears the pool. -
addResourceFile
Adds the given ResourceFile to this pool. -
addResourceFile
Adds the given ResourceFile with the given name to this pool. -
removeResourceFile
Removes the specified ResourceFile from this pool. -
getResourceFile
Returns a ResourceFile from this pool, based on its name. Returnsnullif the instance with the given name is not in the pool.- Specified by:
getResourceFilein interfaceFilePool
-
size
public int size()Returns the number of resource files in this pool. -
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
Returns a Set of all resource file names in this resource file pool.- Specified by:
resourceFileNamesin interfaceFilePool
-
resourceFilesAccept
Applies the given ResourceFileVisitor to all instances in this pool.- Specified by:
resourceFilesAcceptin interfaceFilePool
-
resourceFilesAccept
Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filter.- Specified by:
resourceFilesAcceptin interfaceFilePool
-
resourceFilesAccept
public void resourceFilesAccept(List<String> fileNameFilter, ResourceFileVisitor resourceFileVisitor) Applies the given ResourceFileVisitor to all resource files in this pool matching the given file name filters.- Specified by:
resourceFilesAcceptin interfaceFilePool
-
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.- Specified by:
resourceFilesAcceptin interfaceFilePool
-
toString
-