Package Behavioral.Iterator
Class ConcreteAggregate<T>
java.lang.Object
Behavioral.Iterator.ConcreteAggregate<T>
- Type Parameters:
T- The type of elements in the collection.
- All Implemented Interfaces:
Aggregate<T>
Concrete Aggregate that holds a collection of items.
Implements the Aggregate interface and provides a method to create iterators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an item to the collection.Create an iterator for the collection.
-
Constructor Details
-
ConcreteAggregate
public ConcreteAggregate()Constructor initializes an empty collection.
-
-
Method Details
-
addItem
Add an item to the collection.- Parameters:
item- The item to add.
-
createIterator
Description copied from interface:AggregateCreate an iterator for the collection.- Specified by:
createIteratorin interfaceAggregate<T>- Returns:
- An iterator for the collection.
-