Class SizeLimitCollection
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.resources.AbstractResourceCollectionWrapper
org.apache.tools.ant.types.resources.BaseResourceCollectionWrapper
org.apache.tools.ant.types.resources.SizeLimitCollection
- All Implemented Interfaces:
- Cloneable,- Iterable<Resource>,- ResourceCollection
- Direct Known Subclasses:
- AllButFirst,- AllButLast,- First,- Last
ResourceCollection that imposes a size limit on another ResourceCollection.
- Since:
- Ant 1.7.1
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class org.apache.tools.ant.types.resources.BaseResourceCollectionWrappercreateIterator, getCollection, getSizeMethods inherited from class org.apache.tools.ant.types.resources.AbstractResourceCollectionWrapperadd, dieOnCircularReference, getResourceCollection, isCache, isFilesystemOnly, iterator, setCache, toStringMethods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributesMethods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectMethods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
- 
Constructor Details- 
SizeLimitCollectionpublic SizeLimitCollection()
 
- 
- 
Method Details- 
setCountpublic void setCount(int i) Set the number of resources to be included.- Parameters:
- i- the count as- int.
 
- 
getCountpublic int getCount()Get the number of resources to be included. Default is 1.- Returns:
- the count as int.
 
- 
sizepublic int size()Efficient size implementation.- Specified by:
- sizein interface- ResourceCollection
- Overrides:
- sizein class- AbstractResourceCollectionWrapper
- Returns:
- int size
 
- 
getValidCountprotected int getValidCount()Get the count, verifying it is >= 0.- Returns:
- int count
 
 
-