public static final class TrailItemSet.SpecificItems extends TrailItemSet
TrailItemSet.AllItems, TrailItemSet.Collector, TrailItemSet.None, TrailItemSet.OneItem, TrailItemSet.OneType, TrailItemSet.ReadVisitor, TrailItemSet.SpecificItems, TrailItemSet.SpecificTypes, TrailItemSet.Visitor| 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.
|
Set<ItemIdentity> |
getItems() |
TrailItemSet |
union(TrailItemSet anotherSet)
Creates a new set with all items from
this and anotherSet sets. |
containsAny, equals, hashCode, isEmpty, of, of, ofTypes, toStringpublic boolean contains(ItemIdentity id)
TrailItemSetcontains in class TrailItemSetid - item ID@NotNull public Set<ItemIdentity> getItems()
@NotNull public TrailItemSet expand(@Nullable ItemIdentity trailItem)
TrailItemSetExpands 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 TrailItemSettrailItem - item to add to the settrailItem@NotNull public TrailItemSet union(@Nullable TrailItemSet anotherSet)
TrailItemSetCreates a new set with all items from this and anotherSet sets.
If anotherSet == null or this.equals(anotherSet) - this set should be returned
Note that:
AllItems set union with any set is always AllItems set.None union with non null anotherSet set is always anotherSet set.AllItems set if number of types after union is sufficient.union in class TrailItemSetanotherSet - - another set to union with thisthis set and anotherSetpublic void accept(@NotNull
TrailItemSet.Visitor visitor)
TrailItemSetaccept in class TrailItemSetCopyright © 2021 ALM Works. All Rights Reserved.