public static final class TrailItemSet.OneItem extends TrailItemSet
TrailItemSet.AllItems, TrailItemSet.Collector, TrailItemSet.None, TrailItemSet.OneItem, TrailItemSet.OneType, TrailItemSet.ReadVisitor, TrailItemSet.SpecificItems, TrailItemSet.SpecificTypes, TrailItemSet.Visitor
Constructor and Description |
---|
OneItem(ItemIdentity item) |
Modifier and Type | Method and Description |
---|---|
void |
accept(TrailItemSet.Visitor visitor)
Allows the caller to perform per-subclass actions.
|
boolean |
contains(ItemIdentity id)
Checks if the set contains the given item.
|
TrailItemSet |
expand(ItemIdentity trailItem)
Expands the set to include the given item.
|
TrailItemSet |
expand(TrailItemSet trailItemSet)
Expands the set to include the given items.
|
ItemIdentity |
getItem() |
equals, fromValues, hashCode, isEmpty, of, ofTypes, toString
public OneItem(@NotNull ItemIdentity item)
public boolean contains(ItemIdentity id)
TrailItemSet
contains
in class TrailItemSet
id
- item ID@NotNull public TrailItemSet expand(@Nullable ItemIdentity trailItem)
TrailItemSet
Expands the set to include the given item. The result of this operation is a new set, which a) includes everything this set includes, b) includes given item.
Note that the resulting set may contain more items, due to escalation to a more wide set class. If you expand a set by a sufficient number of items, it will switch to be type-based set, which will contain all items of the given types.
expand
in class TrailItemSet
trailItem
- item to add to the settrailItem
@NotNull public TrailItemSet expand(@Nullable TrailItemSet trailItemSet)
TrailItemSet
Expands the set to include the given items. The result of this operation is a set, which includes everything both this set and parameter set.
Note that the resulting set may contain more items, due to escalation to a more wide set class. If you expand a set by a sufficient number of items, it will switch to be type-based set, which will contain all items of the given types.
expand
in class TrailItemSet
trailItemSet
- item set to add to this settrailItem
public void accept(@NotNull TrailItemSet.Visitor visitor)
TrailItemSet
accept
in class TrailItemSet
@NotNull public ItemIdentity getItem()
Copyright © 2019 ALM Works. All Rights Reserved.