|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.data.VoidData
com.davisor.data.stream.TupleDataStream
A TupleDataStream allows tuple elements in a tuple data stream to be rearranged at will, or to make ordinary data streams tuple streams.
TupleData,
TupleType| Field Summary | |
protected TupleData |
M_data
Next element, if any. |
protected long |
M_index
Element id counter. |
protected int[] |
M_map
Tuple element reorder indexes. |
protected java.lang.Object |
M_metaData
Stream meta data (may be null). |
protected DataStream |
M_stream
Source stream. |
protected boolean |
M_tuplify
Tuple element arrangement method indicator. |
| Fields inherited from class com.davisor.data.VoidData |
M_type |
| Fields inherited from interface com.davisor.data.stream.DataStream |
INITIAL_INDEX |
| Constructor Summary | |
TupleDataStream(DataStream stream)
Creates a tuple data stream from any data stream. |
|
TupleDataStream(DataStream stream,
TupleType type)
Creates a tuple data stream from any data stream. |
|
TupleDataStream(DataStream stream,
TupleType type,
int[] map)
Creates a tuple data stream from any data stream. |
|
| Method Summary | |
boolean |
close()
This method frees resources for cargabe collection. |
long |
getIndex()
Retrieves the index number of the element returned by the latest next() call. |
boolean |
hasNext()
Tests if the stream still contains data. |
DataValue |
next()
Gets the next data from the stream. |
| Methods inherited from class com.davisor.data.VoidData |
equals, getDataValue, getType, hashCode, setType, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.davisor.data.Data |
getType |
| Field Detail |
protected TupleData M_data
protected long M_index
protected int[] M_map
protected java.lang.Object M_metaData
protected DataStream M_stream
protected boolean M_tuplify
| Constructor Detail |
public TupleDataStream(DataStream stream)
throws InvalidDataException
stream - source stream
InvalidDataException - if the collection content does not
satisfy the given type.TupleType.getTypeIndex(java.lang.String),
TupleType.getTypeIndexMap(com.davisor.data.TupleType),
TupleType.rearrange(com.davisor.data.TupleData, int[])
public TupleDataStream(DataStream stream,
TupleType type)
throws InvalidDataException
stream - source streamtype - new type
InvalidDataException - if the collection content does not
satisfy the given type.TupleType.getTypeIndex(java.lang.String),
TupleType.getTypeIndexMap(com.davisor.data.TupleType),
TupleType.rearrange(com.davisor.data.TupleData, int[])
public TupleDataStream(DataStream stream,
TupleType type,
int[] map)
throws InvalidDataException
stream - source streamtype - new typemap - precomputed tuple member index map
InvalidDataException - if the collection content does not
satisfy given type.TupleType.getTypeIndex(java.lang.String),
TupleType.getTypeIndexMap(com.davisor.data.TupleType),
TupleType.rearrange(com.davisor.data.TupleData, int[])| Method Detail |
public boolean close()
close in interface DataStreamDataStream.hasNext()public long getIndex()
next() call. The index represents the position of the
element within this stream. The stream index may or may
not be equal to any other indexes the element itself thinks it
posesses.
The index value is initially -1, indicating no
element. After first next() call, index becomes 0, then
1, and so on. This functionality resembles
java.sql.resultSet#getRow method functionality, but
with the difference that the index counter starts from 0, not 1.
getIndex in interface DataStreampublic boolean hasNext()
hasNext in interface DataStreamtrue if it does.
public DataValue next()
throws InvalidDataException
next in interface DataStreamInvalidDataException - if the collection content does not
satisfy the given type.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||