Package org.apache.calcite.util
Class NameMap<V>
- java.lang.Object
-
- org.apache.calcite.util.NameMap<V>
-
- Type Parameters:
V
- Value type
public class NameMap<V> extends java.lang.Object
Map whose keys are names and can be accessed with and without case sensitivity.
-
-
Method Summary
All Methods Static 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()
static <V> NameMap
immutableCopyOf(java.util.Map<java.lang.String,V> names)
Creates a NameMap that is an immutable copy of a given map.java.util.NavigableMap<java.lang.String,V>
map()
Returns the underlying map.void
put(java.lang.String name, V v)
java.util.NavigableMap<java.lang.String,V>
range(java.lang.String name, boolean caseSensitive)
Returns a map containing all the entries in the map that match the given name.V
remove(java.lang.String key)
java.lang.String
toString()
-
-
-
Field Detail
-
map
private final java.util.NavigableMap<java.lang.String,V> map
-
-
Constructor Detail
-
NameMap
private NameMap(java.util.NavigableMap<java.lang.String,V> map)
Creates a NameSet based on an existing set.
-
NameMap
public NameMap()
Creates a NameMap, initially empty.
-
-
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
-
immutableCopyOf
public static <V> NameMap immutableCopyOf(java.util.Map<java.lang.String,V> names)
Creates a NameMap that is an immutable copy of a given map.
-
put
public void put(java.lang.String name, V v)
-
range
public java.util.NavigableMap<java.lang.String,V> range(java.lang.String name, boolean caseSensitive)
Returns a map containing all the entries in the map that match the given name. If case-sensitive, that map will have 0 or 1 elements; if case-insensitive, it may have 0 or more.
-
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,V> map()
Returns the underlying map.
-
remove
public V remove(java.lang.String key)
-
-