com.xj.anylogic.engine
Class Dimension

java.lang.Object
  extended by com.xj.anylogic.engine.Dimension
All Implemented Interfaces:
java.io.Serializable

public final class Dimension
extends java.lang.Object
implements java.io.Serializable

A dimension of a HyperArray - a set of non-negative integers (or identifiers mapped to non-negative integers) that are used as indexes in hyper arrays. An index cannot be included in a dimension more than once.
A dimension can be a sub-dimension of another dimension, in this case it contains a subset (or maybe a full set) of the super dimension indexes. The top level dimension in the dimension hierarchy does not have a super- dimension.
Optionally, you can provide names for indexes at a top-level dimension.

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Field Summary
 int[] indexes
          An array of indexes included in this dimension.
 
Constructor Summary
Dimension(java.lang.String name, Dimension superdim, int... indexes)
          Deprecated. this method is obsolete and will be removed in the next release! Please use Dimension(String, String, Dimension, int...) instead
Dimension(java.lang.String name, int... indexes)
          Deprecated. this method is obsolete and will be removed in the next release! Please use Dimension(String, String, int...) instead
Dimension(java.lang.String name, int[] indexes, java.lang.String[] indexnames)
          Deprecated. this method is obsolete and will be removed in the next release! Please use Dimension(String, String, int[], String[]) instead
Dimension(java.lang.String packageName, java.lang.String name, Dimension superdim, int... indexes)
          Creates a sub-dimension of another dimension.
Dimension(java.lang.String packageName, java.lang.String name, Dimension superdim, java.lang.String indexes)
          Creates a sub-dimension of another dimension.
Dimension(java.lang.String packageName, java.lang.String name, int... indexes)
          Creates a top-level dimension with a given name and given set of integer indexes not having names.
Dimension(java.lang.String packageName, java.lang.String name, int[] indexes, java.lang.String[] indexnames)
          Creates a top-level dimension with a given name and given set of integer indexes, each having a name.
Dimension(java.lang.String packageName, java.lang.String name, java.lang.String indexes)
          Creates a top-level dimension with a given name and given set of integer indexes not having names.
 
Method Summary
 int getIndexByName(java.lang.String name)
          Returns the index having the specified textual name.
 int getIndexByPosition(int position)
          Returns the index having the specified position in this dimension (from 0 to size()-1).
 java.lang.String getIndexName(int ind)
          Returns the textual name of the given index, or its formatted integer value in case index name is not set.
 java.lang.String getIndexNameByPosition(int position)
          Returns the textual name of the index located at the given position, or formatted integer value of the index in case index name is not set.
 int getIndexPosition(int ind)
          Returns the position of an index in this dimension, starting from 0.
 int getIndexPositionByName(java.lang.String name)
          Returns the position of the index in this dimension (from 0 to size()-1) having the specified textual name.
 java.lang.String getName()
          Returns the name of the dimension.
 Dimension getSuperDimension()
          Returns super-dimension of this dimension or null if this is a top-level dimension.
 int size()
          Returns the number of indexes in the dimension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexes

public final transient int[] indexes
An array of indexes included in this dimension.

Constructor Detail

Dimension

public Dimension(java.lang.String packageName,
                 java.lang.String name,
                 int... indexes)
Creates a top-level dimension with a given name and given set of integer indexes not having names. Such dimension may not be a sub-dimension of another dimension.

Parameters:
packageName - the name of the model package this dimension belongs to
name - the name of the dimension
indexes - the set of indexes (nonnegative integers)

Dimension

public Dimension(java.lang.String packageName,
                 java.lang.String name,
                 java.lang.String indexes)
Creates a top-level dimension with a given name and given set of integer indexes not having names. Such dimension may not be a sub-dimension of another dimension.

Parameters:
packageName - the name of the model package this dimension belongs to
name - the name of the dimension
indexes - the string with a set of ranges and indexes (nonnegative integers), e.g. "1,3,90-100, 70"

Dimension

@Deprecated
public Dimension(java.lang.String name,
                            int... indexes)
Deprecated. this method is obsolete and will be removed in the next release! Please use Dimension(String, String, int...) instead


Dimension

public Dimension(java.lang.String packageName,
                 java.lang.String name,
                 int[] indexes,
                 java.lang.String[] indexnames)
Creates a top-level dimension with a given name and given set of integer indexes, each having a name. Such dimension may not be a sub-dimension of another dimension.

Parameters:
packageName - the name of the model package this dimension belongs to
name - the name of the dimension
indexes - the set of indexes (nonnegative integers)
indexnames - index names, a name for each index

Dimension

public Dimension(java.lang.String name,
                 int[] indexes,
                 java.lang.String[] indexnames)
Deprecated. this method is obsolete and will be removed in the next release! Please use Dimension(String, String, int[], String[]) instead


Dimension

public Dimension(java.lang.String packageName,
                 java.lang.String name,
                 Dimension superdim,
                 int... indexes)
Creates a sub-dimension of another dimension. The indexes listed must be included in the super-dimension index set. For index names the this dimension will lookup its super dimension.

Parameters:
packageName - the name of the model package this dimension belongs to
name - the name of the dimension
superdim - the super-dimension
indexes - the set of indexes (nonnegative integers)

Dimension

public Dimension(java.lang.String packageName,
                 java.lang.String name,
                 Dimension superdim,
                 java.lang.String indexes)
Creates a sub-dimension of another dimension. The indexes listed must be included in the super-dimension index set.

Parameters:
packageName - the name of the model package this dimension belongs to
name - the name of the dimension
superdim - the super-dimension
indexes - the string with a set of ranges and indexes (nonnegative integers), e.g. "1,3,90-100, 70"

Dimension

public Dimension(java.lang.String name,
                 Dimension superdim,
                 int... indexes)
Deprecated. this method is obsolete and will be removed in the next release! Please use Dimension(String, String, Dimension, int...) instead

Method Detail

getName

public java.lang.String getName()
Returns the name of the dimension.

Returns:
the name of the dimension

size

public int size()
Returns the number of indexes in the dimension.

Returns:
the number of indexes in the dimension

getSuperDimension

public Dimension getSuperDimension()
Returns super-dimension of this dimension or null if this is a top-level dimension.

Returns:
super-dimension of this dimension or null

getIndexPosition

public int getIndexPosition(int ind)
Returns the position of an index in this dimension, starting from 0.

Parameters:
ind - the index
Returns:
the position of the index

getIndexName

public java.lang.String getIndexName(int ind)
Returns the textual name of the given index, or its formatted integer value in case index name is not set.

Parameters:
ind - the index
Returns:
the name of the index

getIndexNameByPosition

public java.lang.String getIndexNameByPosition(int position)
Returns the textual name of the index located at the given position, or formatted integer value of the index in case index name is not set.

Parameters:
position - the position of the index (in the range 0...size() - 1)
Returns:
the name of the index located at the given position

getIndexByPosition

public int getIndexByPosition(int position)
Returns the index having the specified position in this dimension (from 0 to size()-1).

Parameters:
position - the position of the index in this dimension
Returns:
the index

getIndexByName

public int getIndexByName(java.lang.String name)
Returns the index having the specified textual name.

Parameters:
name - the name of the index
Returns:
the index, or -1 if not found

getIndexPositionByName

public int getIndexPositionByName(java.lang.String name)
Returns the position of the index in this dimension (from 0 to size()-1) having the specified textual name.

Parameters:
name - the name of the index
Returns:
the position of the index (in the range 0...size() - 1), or -1 if not found


Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.