TItem
- The type of the items in the collection.public class ItemCollection<TItem> extends Object
LayoutData
.
Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties
Items
, Mapper
, and Delegate
should be set on each
instance.
This class supports LayoutData
implementations and does not usually have to be used explicitly.
Constructor and Description |
---|
ItemCollection() |
Modifier and Type | Method and Description |
---|---|
Predicate<TItem> |
getDelegate()
Gets a delegate from the items to a boolean value.
|
Collection<TItem> |
getItems()
Gets a collection of items.
|
IMapper<TItem,Boolean> |
getMapper()
Gets a mapping from the items to a boolean value.
|
IMapper<TItem,Boolean> |
provideMapper(LayoutGraphAdapter adapter,
ILayoutAlgorithm layout)
Provides a mapper describing which elements are contained in this
ItemCollection . |
void |
setDelegate(Predicate<TItem> value)
Sets a delegate from the items to a boolean value.
|
void |
setItems(Collection<TItem> value)
Sets a collection of items.
|
void |
setMapper(IMapper<TItem,Boolean> value)
Sets a mapping from the items to a boolean value.
|
void |
setSource(Iterable<TItem> value)
Sets an enumerable of items.
|
public final Predicate<TItem> getDelegate()
The returned boolean value describes whether an item is contained in the collection.
setDelegate(Predicate)
public final Collection<TItem> getItems()
This collection contains exactly the items in the given collection.
setItems(Collection)
public final IMapper<TItem,Boolean> getMapper()
The mapped boolean value specifies whether an item is contained in the collection.
setMapper(IMapper)
public IMapper<TItem,Boolean> provideMapper(LayoutGraphAdapter adapter, ILayoutAlgorithm layout)
ItemCollection
.adapter
- The graph adapter the mapper shall be provided for.layout
- The layout using the item collection.public final void setDelegate(Predicate<TItem> value)
The returned boolean value describes whether an item is contained in the collection.
value
- The Delegate to set.getDelegate()
public final void setItems(Collection<TItem> value)
This collection contains exactly the items in the given collection.
value
- The Items to set.getItems()
public final void setMapper(IMapper<TItem,Boolean> value)
The mapped boolean value specifies whether an item is contained in the collection.
value
- The Mapper to set.getMapper()