Class SizeLimitCollection

All Implemented Interfaces:
Cloneable, Iterable<Resource>, ResourceCollection
Direct Known Subclasses:
AllButFirst, AllButLast, First, Last

public abstract class SizeLimitCollection extends BaseResourceCollectionWrapper
ResourceCollection that imposes a size limit on another ResourceCollection.
Since:
Ant 1.7.1
  • Constructor Details

    • SizeLimitCollection

      public SizeLimitCollection()
  • Method Details

    • setCount

      public void setCount(int i)
      Set the number of resources to be included.
      Parameters:
      i - the count as int.
    • getCount

      public int getCount()
      Get the number of resources to be included. Default is 1.
      Returns:
      the count as int.
    • size

      public int size()
      Efficient size implementation.
      Specified by:
      size in interface ResourceCollection
      Overrides:
      size in class AbstractResourceCollectionWrapper
      Returns:
      int size
    • getValidCount

      protected int getValidCount()
      Get the count, verifying it is >= 0.
      Returns:
      int count