opendap.dap
Class DArrayDimension

java.lang.Object
  extended by opendap.dap.DArrayDimension
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class DArrayDimension
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class holds information about each dimension in a DArray. Each array dimension carries with it its own projection information, as well as it's name and size.

The projection information takes the form of three integers: the start, stop, and stride values. This is clearest with an example. Consider a one-dimensional array 10 elements long. If the start value of the dimension constraint is 3, then the constrained array appears to be seven elements long. If the stop value is changed to 7, then the array appears to be five elements long. If the stride is changed to two, the array will appear to be 3 elements long. Array constraints are written as [start:stride:stop].

See Also:
DArray, Serialized Form

Constructor Summary
DArrayDimension(int size, java.lang.String name)
          Construct a new DArrayDimension.
DArrayDimension(int size, java.lang.String name, boolean decodeName)
          Construct a new DArrayDimension.
 
Method Summary
 java.lang.Object clone()
          Clone this object
 java.lang.String getClearName()
          Get the dimension name.
 java.lang.String getName()
          Get the dimension name.
 int getSize()
          Get the dimension size.
 int getStart()
          Get the projection start point for this dimension.
 int getStop()
          Get the projection stop point for this dimension.
 int getStride()
          Get the projection stride size for this dimension.
 void setClearName(java.lang.String name)
          Set the dimension name.
 void setName(java.lang.String name)
          Set the dimension name.
 void setProjection(int start, int stride, int stop)
          Set the projection information for this dimension.
 void setSize(int size)
          Set the dimension size.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DArrayDimension

public DArrayDimension(int size,
                       java.lang.String name)
Construct a new DArrayDimension.

Parameters:
size - The size of the dimension.
name - The dimension's name, or null if no name.

DArrayDimension

public DArrayDimension(int size,
                       java.lang.String name,
                       boolean decodeName)
Construct a new DArrayDimension.

Parameters:
size - The size of the dimension.
name - The dimension's name, or null if no name.
Method Detail

clone

public java.lang.Object clone()
Clone this object

Overrides:
clone in class java.lang.Object

getName

public java.lang.String getName()
Get the dimension name.


setName

public void setName(java.lang.String name)
Set the dimension name.


getClearName

public java.lang.String getClearName()
Get the dimension name.


setClearName

public void setClearName(java.lang.String name)
Set the dimension name.


getSize

public int getSize()
Get the dimension size.


setSize

public void setSize(int size)
Set the dimension size.


setProjection

public void setProjection(int start,
                          int stride,
                          int stop)
                   throws InvalidParameterException
Set the projection information for this dimension. The parameters start stride and stop are checked to verify that they make sense relative to each other and to the size of this dimension. If not an Invalid ParameterException is thrown. The general rule is: 0<=start<size, 0<stride, 0<=stop
Parameters:
start - The starting point for the projection of this DArrayDimension.
stride - The size of the stride for the projection of this DArrayDimension.
stop - The stopping point for the projection of this DArrayDimension.
Throws:
InvalidParameterException

getStart

public int getStart()
Get the projection start point for this dimension.


getStride

public int getStride()
Get the projection stride size for this dimension.


getStop

public int getStop()
Get the projection stop point for this dimension.