public class ResourceFilePool extends java.lang.Object implements FilePool
ResourceFile
instances. They can be enumerated or retrieved by name.
They can also be accessed by means of resource file visitors.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,ResourceFile> |
resourceFileMap |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addResourceFile(ResourceFile resourceFile)
Adds the given ResourceFile to this pool.
|
void |
addResourceFile(java.lang.String fileName,
ResourceFile resourceFile)
Adds the given ResourceFile with the given name 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.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.
|
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.
|
int |
size()
Returns the number of resource files in this pool.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
resourceFileAccept
protected final java.util.Map<java.lang.String,ResourceFile> resourceFileMap
public ResourceFilePool()
public ResourceFilePool(ResourceFile... resourceFiles)
resourceFiles
- the resource files to be added.public ResourceFilePool(java.lang.Iterable<? extends ResourceFile> resourceFiles)
resourceFiles
- the resource files to be added.public void clear()
public void addResourceFile(ResourceFile resourceFile)
public void addResourceFile(java.lang.String fileName, ResourceFile resourceFile)
public void removeResourceFile(java.lang.String fileName)
public ResourceFile getResourceFile(java.lang.String fileName)
null
if the
instance with the given name is not in the pool.getResourceFile
in interface FilePool
public int size()
public ResourceFilePool refreshedCopy()
public java.util.Set<java.lang.String> resourceFileNames()
resourceFileNames
in interface FilePool
public void resourceFilesAccept(ResourceFileVisitor resourceFileVisitor)
resourceFilesAccept
in interface FilePool
public void resourceFilesAccept(java.lang.String fileNameFilter, ResourceFileVisitor resourceFileVisitor)
resourceFilesAccept
in interface FilePool
public void resourceFilesAccept(java.util.List<java.lang.String> fileNameFilter, ResourceFileVisitor resourceFileVisitor)
resourceFilesAccept
in interface FilePool
public void resourceFilesAccept(StringMatcher fileNameFilter, ResourceFileVisitor resourceFileVisitor)
resourceFilesAccept
in interface FilePool
public java.lang.String toString()
toString
in class java.lang.Object