ucar.multiarray
Class ConcreteIndexMap.ZZMap
java.lang.Object
ucar.multiarray.ConcreteIndexMap.ZZMap
- Enclosing class:
- ConcreteIndexMap
protected class ConcreteIndexMap.ZZMap
- extends Object
An Map of int by int key. (Z is the math symbol for integers).
A Map maps keys to values.
A Map cannot contain duplicate keys;
each key can map to at most one value.
For this implementation, the keys are restricted to non-negative
integers, and we only use non-negative integers as values.
A ZZMap is like a readonly 1-d array of int.
The size()
method returns the array length.
The get(int ii)
method returns the int stored at
position ii
;
This class also supports a functional composition framework via
the setPrev() method. The implementation of get(int) and size()
provided here is simply the identity composed with whatever.
Subclasses will override this functionality.
ConcreteIndexMap.ZZMap
protected ConcreteIndexMap.ZZMap()
ConcreteIndexMap.ZZMap
protected ConcreteIndexMap.ZZMap(ConcreteIndexMap.ZZMap prev)
- Construct a ZZMap form the functional composition
of the new Map with another.
rebind(int [] range) calls prev.rebind(range),
get(int key) is composed as get(prev.get(key))
- Parameters:
prev
- ZZMap this is composed with.
toString
public String toString()
- Overrides:
toString
in class Object