ch.javasoft.util.intcoll
Class KeyRangeIntIntMap
java.lang.Object
java.util.AbstractMap<Integer,Integer>
ch.javasoft.util.intcoll.AbstractIntIntMap
ch.javasoft.util.intcoll.KeyRangeIntIntMap
- All Implemented Interfaces:
- IntIntMap, IntMap<Integer>, Serializable, Map<Integer,Integer>
public class KeyRangeIntIntMap
- extends AbstractIntIntMap
- implements Serializable
KeyRangeIntIntMap is an immutable mapping from int to int. The
lowest key is zero, the next larger key is one and so on, i.e. all k keys are
key in [0..k-1]. The values can be any integer value.
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
| Methods inherited from interface java.util.Map |
hashCode |
KeyRangeIntIntMap
public KeyRangeIntIntMap(int size)
- Constructor for a new identity mapping, i.e. val[key] == key
KeyRangeIntIntMap
public KeyRangeIntIntMap(int[] mapping)
getInt
public int getInt(int key)
- Description copied from interface:
IntIntMap
- Returns the int value for the specified key, or throws a
NoSuchElementException otherwise
- Specified by:
getInt in interface IntIntMap
- Parameters:
key - the key for which the value shall be returned
- Returns:
- the value associated with the given key
containsKey
public boolean containsKey(int key)
- Specified by:
containsKey in interface IntIntMap- Specified by:
containsKey in interface IntMap<Integer>- Overrides:
containsKey in class AbstractIntIntMap
containsValue
public boolean containsValue(int value)
- Specified by:
containsValue in interface IntIntMap
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Map<Integer,Integer>- Overrides:
isEmpty in class AbstractIntIntMap
size
public int size()
- Specified by:
size in interface Map<Integer,Integer>- Overrides:
size in class AbstractMap<Integer,Integer>
keySet
public IntSet keySet()
- Specified by:
keySet in interface IntMap<Integer>- Specified by:
keySet in interface Map<Integer,Integer>- Specified by:
keySet in class AbstractIntIntMap
intIntEntrySet
public Set<IntIntMap.IntIntEntry> intIntEntrySet()
- Specified by:
intIntEntrySet in interface IntIntMap
values
public IntCollection values()
- Specified by:
values in interface IntIntMap- Specified by:
values in interface Map<Integer,Integer>- Specified by:
values in class AbstractIntIntMap
toArray
public int[] toArray()
- Returns a copy of the underlying mapping array. The value corresponding
to a key k is array[k].
- Returns:
- a copy of the mapping array
equals
public boolean equals(Object o)
- Specified by:
equals in interface Map<Integer,Integer>- Overrides:
equals in class AbstractMap<Integer,Integer>
put
public Integer put(int key,
Integer value)
- Always throws an
UnsupportedOperationException
- Specified by:
put in interface IntMap<Integer>- Overrides:
put in class AbstractIntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
IntMap.put(int, java.lang.Object)
put
public Integer put(int key,
int value)
- Always throws an
UnsupportedOperationException
- Specified by:
put in interface IntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
IntIntMap.put(int, int)
put
public Integer put(Integer key,
Integer value)
- Always throws an
UnsupportedOperationException
- Specified by:
put in interface Map<Integer,Integer>- Overrides:
put in class AbstractIntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
AbstractIntIntMap.put(java.lang.Integer, java.lang.Integer)
putAll
public void putAll(Map<? extends Integer,? extends Integer> map)
- Always throws an
UnsupportedOperationException
- Specified by:
putAll in interface Map<Integer,Integer>- Overrides:
putAll in class AbstractIntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
AbstractIntIntMap.putAll(java.util.Map)
putAll
public void putAll(IntMap<? extends Integer> map)
- Always throws an
UnsupportedOperationException
- Specified by:
putAll in interface IntMap<Integer>- Overrides:
putAll in class AbstractIntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
IntMap.putAll(ch.javasoft.util.intcoll.IntMap)
putAll
public void putAll(IntIntMap map)
- Always throws an
UnsupportedOperationException
- Specified by:
putAll in interface IntIntMap- Overrides:
putAll in class AbstractIntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
IntIntMap.putAll(ch.javasoft.util.intcoll.IntIntMap)
remove
public Integer remove(int key)
- Always throws an
UnsupportedOperationException
- Specified by:
remove in interface IntMap<Integer>
- Throws:
UnsupportedOperationException - always- See Also:
IntMap.remove(int)
remove
public Integer remove(Object key)
- Always throws an
UnsupportedOperationException
- Specified by:
remove in interface Map<Integer,Integer>- Overrides:
remove in class AbstractIntIntMap
- Throws:
UnsupportedOperationException - always- See Also:
AbstractIntIntMap.remove(java.lang.Object)
clear
public void clear()
- Always throws an
UnsupportedOperationException
- Specified by:
clear in interface Map<Integer,Integer>- Overrides:
clear in class AbstractMap<Integer,Integer>
- Throws:
UnsupportedOperationException - always- See Also:
AbstractMap.clear()