|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.storage.olap.embedded.Tuple
public class Tuple
Used for building the Tuples of an in memory multidimensional ResultSet This implementation is designed for the simple definition of a tuple in a multidimensional ResultSet. The tuples are stored in memory within the model.
The tuple concept is a core element of the result set metadata. It combines members from each dimension that is projected onto the axis. Each axis contains a set of tuples with each one representing a single point on the axis. The tuple Index uniquely identifies the position of the tuple on the axis.
{(2000, Chairs)} is an example of a tuple where the Time and Products dimensions are projected onto the axis. While this example displays a set of two labels, "2000" and "Chairs", each element of a tuple may contain more information than just the displayable text. This information is found in the tuple elements which are returned from the getTupleElements() method.
TupleInterface
,
AxisInterface
,
ResultSetMetadata
Constructor Summary | |
---|---|
Tuple()
Default tuple with no elements |
|
Tuple(TupleElementInterface[] tupleElements)
Create a tuple with the elements |
Method Summary | |
---|---|
void |
addElement(int index,
TupleElementInterface element)
Add a tupleElement at the specfied index. |
void |
addElement(TupleElementInterface element)
Append a tupleElement. |
AxisInterface |
getAxis()
Returns the axis for the tuple. |
TupleElementInterface |
getElement(int index)
Returns TupleElement for this tuple |
TupleElementInterface[] |
getElements(int index,
int count)
Returns TupleElements for this tuple |
int |
getTupleDepth()
Return the number of elements in this tuple. |
int |
getTupleIndex()
Returns the tuple ordinal if set. |
TupleElementInterface |
removeElement(int index)
Remove a tuple element from this tuple. |
void |
setAxis(AxisInterface axis)
Set the axis for this tuple. |
void |
setElements(int index,
int endIndex,
TupleElementInterface[] tupleElements)
Sets TupleElements for this tuple |
Constructor Detail |
---|
public Tuple() throws OLAPException
OLAPException
public Tuple(TupleElementInterface[] tupleElements) throws OLAPException
tupleElements
- the elements that makes this tuple. The outer most element on the
row/column has index zero and the inner most element has index
element count -1.
OLAPException
- if the tuple cannot be createdMethod Detail |
---|
public int getTupleIndex() throws OLAPException
getTupleIndex
in interface TupleInterface
OLAPException
- if cannot get the coordinatepublic TupleElementInterface getElement(int index) throws OLAPException
getElement
in interface TupleInterface
index
- index of the element in this tuple. index should in the range of
zero to current element count.
OLAPException
- if the elements cannot be retrievedpublic TupleElementInterface[] getElements(int index, int count) throws OLAPException
getElements
in interface TupleInterface
index
- index of the element in this tuple. index should in the range of
zero to current element count.count
- number of elements to be returned.
OLAPException
- if the elements cannot be retrievedpublic void addElement(TupleElementInterface element) throws OLAPException
tupleElement
- to insert
OLAPException
- if the tuple element cannot be addedpublic void addElement(int index, TupleElementInterface element) throws OLAPException
index
- to insert the tupleElementtupleElement
- to insert
OLAPException
- if the tuple element cannot be addedpublic void setElements(int index, int endIndex, TupleElementInterface[] tupleElements) throws OLAPException
index
- beginning index for setting the elementsendIndex
- exclusive ending indextupleElements
- An array of tuple labels for this tuple. The length of this array
should be equal to the tuple depth for the axis associated with this tuple.
The labels are ordered from least to most specific. For example,
[North America, USA, North Carolina, Cary].
OLAPException
public TupleElementInterface removeElement(int index) throws OLAPException
index
- element index in the tuple. index should be greater than zero and less than
current element count.
OLAPException
- if the element cannot be removedpublic AxisInterface getAxis() throws OLAPException
getAxis
in interface TupleInterface
OLAPException
- if the axis cannot be returnedpublic void setAxis(AxisInterface axis) throws OLAPException
axis
- for the tuple
OLAPException
- if the axis cannot be setpublic int getTupleDepth() throws OLAPException
getTupleDepth
in interface TupleInterface
OLAPException
- if cannot get the tupledepth
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |