ucar.multiarray
Class IntArrayAdapter

java.lang.Object
  extended by ucar.multiarray.IntArrayAdapter
All Implemented Interfaces:
IntMap

public class IntArrayAdapter
extends java.lang.Object
implements IntMap

Apply the "Adapter" pattern to convert the interface of Class (int []) to interface IntMap.

Instances of this class are constructed automatically for you when no 'next' argument is provided to the other IntMap constructors.


Constructor Summary
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.
 void rebind(int[] newAdaptee)
          Reset the adaptee converted by this.
 int size()
          Returns the number of key-value mappings in this Map.
 IntArrayAdapter tail(int rank, java.lang.Object prev)
          Instances of this class are always the tail of an IntMap chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntArrayAdapter

public IntArrayAdapter()
Method Detail

get

public int get(int key)
Returns the value to which this Map maps the specified key.

Specified by:
get in interface IntMap
Parameters:
key - int
Returns:
int adaptee[key];

size

public int size()
Returns the number of key-value mappings in this Map.

Specified by:
size in interface IntMap
Returns:
adaptee.length

tail

public IntArrayAdapter tail(int rank,
                            java.lang.Object prev)
Instances of this class are always the tail of an IntMap chain. Initialize the prev member. Call this.rebind(new int[rank]);

Specified by:
tail in interface IntMap
Returns:
this

getLength

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

Specified by:
getLength in interface IntMap

rebind

public void rebind(int[] newAdaptee)
Reset the adaptee converted by this.