ucar.multiarray
Interface IntMap

All Known Implementing Classes:
IntArrayAdapter

public interface IntMap

An immutable Map of int by int key. An Map maps keys to values. A Map cannot contain duplicate keys; each key can map to at most one value.

An IntMap 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;

MultiArray uses array of int for as index (key) values. This interface is an abstraction of those, so that we can implement transformations on them. Beyond the get() and size() methods of the map abstraction, methods used in the context of MultiArrayProxy are present to support connecting the reverse chain of a linked list of IntMap and to traverse the inverse map to discover the shape.

See Also:
ClipMap, DecimateMap, FlattenMap, SliceMap, TransposeMap, MultiArrayProxy, IntArrayAdapter

Method Summary
 int get(int key)
          Returns the value to which this Map maps the specified key.
 int getLength(int ii)
          Traverse the inverse mapping chain to retrieve the dimension length at ii.
 int size()
          Returns the number of key-value mappings in this Map.
 IntArrayAdapter tail(int rank, java.lang.Object prev)
          Return the tail of a chain of IntMap.
 

Method Detail

get

int get(int key)
Returns the value to which this Map maps the specified key. If you think of this as a 1-d array of int, then ia.get(ii) is like ia[ii].

Parameters:
key - int
Returns:
int value

size

int size()
Returns the number of key-value mappings in this Map. If you think of this as a 1-d array of int, then ia.size() is like ia.length.

Returns:
int size

tail

IntArrayAdapter tail(int rank,
                     java.lang.Object prev)
Return the tail of a chain of IntMap. As side effects, connect the prev members and initialize the rank at the tail.


getLength

int getLength(int ii)
Traverse the inverse mapping chain to retrieve the dimension length at ii.