ucar.ma2
Class IndexConstant

java.lang.Object
  extended by ucar.ma2.Index
      extended by ucar.ma2.IndexConstant
All Implemented Interfaces:
Cloneable

public class IndexConstant
extends Index

An Index into an Array that always returns 0. It can have any shape, so it allows you to create a constant Array of any shape.

Author:
caron

Field Summary
 
Fields inherited from class ucar.ma2.Index
current, offset, rank, scalarIndexImmutable, shape, size, stride
 
Constructor Summary
protected IndexConstant(int rank)
           
protected IndexConstant(int[] shape)
           
protected IndexConstant(int[] shape, int[] stride)
           
 
Method Summary
 int currentElement()
          always return 0
 
Methods inherited from class ucar.ma2.Index
clone, computeSize, factory, getCurrentCounter, getRank, getShape, getShape, getSize, incr, precalc, set, set, set, set, set, set, set, set, set0, set1, set2, set3, set4, set5, set6, setCurrentCounter, setDim, toString, toStringDebug
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexConstant

protected IndexConstant(int rank)

IndexConstant

protected IndexConstant(int[] shape)

IndexConstant

protected IndexConstant(int[] shape,
                        int[] stride)
Method Detail

currentElement

public int currentElement()
always return 0

Overrides:
currentElement in class Index
Returns:
the current element's index into the 1D backing array.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.