Package com.petrolpark.util
Interface ISequenceBiMap<K,V,S extends Iterable<K>,E extends ISequenceBiMap.IEntry<K,V,S,E,? super M>,M extends ISequenceBiMap<K,V,S,E,? super M>>
- All Known Implementing Classes:
EnumSequenceBiMap,NestedSequenceBiMap
public interface ISequenceBiMap<K,V,S extends Iterable<K>,E extends ISequenceBiMap.IEntry<K,V,S,E,? super M>,M extends ISequenceBiMap<K,V,S,E,? super M>>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionFollow a sequence of keys until a value is found.Get theISequenceBiMap.IEntryassociated with this key.Get theISequenceBiMap.IEntryat this exact sequence position.getKeySequence(V value) Essentially a shortcut forgetKeySequenceMap().Map.get(Object).The map of values to the sequences by which those values are indexed.values()
-
Method Details
-
get
Get theISequenceBiMap.IEntryassociated with this key. Equivalently, theISequenceBiMap.IEntryassociatedwith the sequence of length1containing this key.- Parameters:
key-- Returns:
nullif noISequenceBiMap.IEntryexists
-
get
Get theISequenceBiMap.IEntryat this exact sequence position.- Parameters:
sequence- Not mutated- Returns:
ISequenceBiMap.IEntryornullif no entry exists with that sequence.- See Also:
-
follow
Follow a sequence of keys until a value is found. A key is taken off the start of the sequence and used to find theISequenceBiMap.IEntrythere. If thisISequenceBiMap.IEntryis a value, this is returned. If it is a sub-map, then the process is repeated with the next key.- Parameters:
sequence- This is shortened by this operation- Returns:
- The value found by following the sequence of keys, or
nullif the sequence reaches a dead end, or the sequence runs out before a value is found. - See Also:
-
getKeySequenceMap
The map of values to the sequences by which those values are indexed.- Returns:
- Non-
nullmap - See Also:
-
getKeySequence
Essentially a shortcut forgetKeySequenceMap().Map.get(Object).- Parameters:
value-- Returns:
- The
sequencesuch thatget(sequence) == value, ornullif that value is not in this Map - See Also:
-
values
Collection<V> values()
-