Package org.apache.calcite.util
Class NameMultimap<V>
- java.lang.Object
-
- org.apache.calcite.util.NameMultimap<V>
-
- Type Parameters:
V
- Value type
public class NameMultimap<V> extends java.lang.Object
Multimap whose keys are names and can be accessed with and without case sensitivity.
-
-
Constructor Summary
Constructors Modifier Constructor Description NameMultimap()
Creates a NameMultimap, initially empty.private
NameMultimap(NameMap<java.util.List<V>> map)
Creates a NameMultimap based on an existing map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.String name, boolean caseSensitive)
Returns whether this map contains a given key, with a given case-sensitivity.boolean
equals(java.lang.Object obj)
int
hashCode()
java.util.NavigableMap<java.lang.String,java.util.List<V>>
map()
Returns the underlying map.void
put(java.lang.String name, V v)
Adds an entry to this multimap.java.util.Collection<java.util.Map.Entry<java.lang.String,V>>
range(java.lang.String name, boolean caseSensitive)
Returns a map containing all the entries in this multimap that match the given name.boolean
remove(java.lang.String key, V value)
Removes all entries that have the given case-sensitive key.java.lang.String
toString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
put
public void put(java.lang.String name, V v)
Adds an entry to this multimap.
-
remove
public boolean remove(java.lang.String key, V value)
Removes all entries that have the given case-sensitive key.- Returns:
- Whether a value was removed
-
range
public java.util.Collection<java.util.Map.Entry<java.lang.String,V>> range(java.lang.String name, boolean caseSensitive)
Returns a map containing all the entries in this multimap that match the given name.
-
containsKey
public boolean containsKey(java.lang.String name, boolean caseSensitive)
Returns whether this map contains a given key, with a given case-sensitivity.
-
map
public java.util.NavigableMap<java.lang.String,java.util.List<V>> map()
Returns the underlying map. Its size is the number of keys, not the number of values.
-
-