public class Resources extends DataType implements AppendableResourceCollection
ResourceCollection
: Either stores nested ResourceCollection
s,
making no attempt to remove duplicates, or references another ResourceCollection
.Modifier and Type | Field and Description |
---|---|
static java.util.Iterator<Resource> |
EMPTY_ITERATOR
static empty Iterator |
static ResourceCollection |
NONE
static empty ResourceCollection |
description, location, project
Constructor and Description |
---|
Resources()
Create a new
Resources . |
Resources(Project project)
Create a new
Resources . |
Modifier and Type | Method and Description |
---|---|
void |
add(ResourceCollection c)
Add a
ResourceCollection . |
protected void |
dieOnCircularReference(java.util.Stack<java.lang.Object> stk,
Project p)
Overrides the base implementation to recurse on all
DataType
child elements that may have been added. |
protected void |
invalidateExistingIterators()
Allow subclasses to notify existing Iterators they have experienced concurrent modification.
|
boolean |
isFilesystemOnly()
Fulfill the
ResourceCollection contract. |
java.util.Iterator<Resource> |
iterator()
Fulfill the
ResourceCollection contract. |
void |
setCache(boolean b)
Set whether to cache collections.
|
int |
size()
Fulfill the
ResourceCollection contract. |
java.lang.String |
toString()
Format this
Resources as a String . |
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isEmpty, stream
public static final ResourceCollection NONE
static
empty ResourceCollection
public static final java.util.Iterator<Resource> EMPTY_ITERATOR
static
empty Iterator
public Resources()
Resources
.public void setCache(boolean b)
b
- boolean
cache flag.public void add(ResourceCollection c)
ResourceCollection
.add
in interface AppendableResourceCollection
c
- the ResourceCollection
to add.public java.util.Iterator<Resource> iterator()
ResourceCollection
contract.public int size()
ResourceCollection
contract.size
in interface ResourceCollection
int
.public boolean isFilesystemOnly()
ResourceCollection
contract.isFilesystemOnly
in interface ResourceCollection
true
if all Resource
s represent files.public java.lang.String toString()
Resources
as a String
.protected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p) throws BuildException
DataType
child elements that may have been added.dieOnCircularReference
in class DataType
stk
- the stack of data types to use (recursively).p
- the Project
to use to dereference the references.BuildException
- on error.protected void invalidateExistingIterators()