|
|||||||||||
| 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.JoinedDataBuffer
A JoinedDataBuffer makes a data buffer out of several parallel buffers. The elements of the new buffer will be tuples with as many elements as there are buffers. Elements of equal sequence numbers make one tuple data value. Missing elements and buffers and buffers shorter than other buffers will show up as null tuple elements.
If source buffers contain tuple-elements, then the buffers may optionally be fused together at the construction time by treating the tuple-elements in the original buffers as separate buffers. A tuple-buffer with N elements will in this case be broken into N separate buffers which will show up as if they would have been inserted separately. The names for these sub-buffers will be taken from their corresponding tuple element type names. Fusing will remove only the first tuple layer leaving other tuple elements deeper down alone.
Access to joined data buffers goes through the tools provided by TupleType and TupleData objects. Please see their respective documentation for more information.
TupleData,
TupleType| Field Summary | |
protected java.util.Map |
bufferMetaData
this meta data is inserted to the data buffer type |
protected DataBuffer[] |
M_buffers
Underlying data buffers. |
protected int |
M_size
Number of elements in the longest buffer. |
| Fields inherited from class com.davisor.data.VoidData |
M_type |
| Constructor Summary | |
protected |
JoinedDataBuffer()
Default constructor. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers)
Creates a data buffer out of an array of buffers. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers,
boolean fuse)
Creates a data buffer out of an array of buffers. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers,
java.lang.String[] ids)
Creates a data buffer out of an array of buffers. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers,
java.lang.String[] ids,
boolean fuse)
Creates a data buffer out of an array of buffers. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer buffer,
java.lang.String bufferID)
Creates a data buffer out of two buffers. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer buffer1,
java.lang.String buffer1ID,
DataBuffer buffer2,
java.lang.String buffer2ID,
boolean fuse)
Creates a data buffer out of two buffers. |
|
JoinedDataBuffer(java.lang.String name,
DataBuffer buffer1,
java.lang.String buffer1ID,
DataBuffer buffer2,
java.lang.String buffer2ID,
DataBuffer buffer3,
java.lang.String buffer3ID,
boolean fuse)
Creates a data buffer out of three buffers. |
|
JoinedDataBuffer(java.lang.String name,
java.util.Iterator lists,
java.util.Iterator types,
java.util.List idList,
boolean fuse)
Creates a data buffer out of a list of data lists, and assosiated list content types. |
|
JoinedDataBuffer(java.lang.String name,
java.util.List bufferList)
Creates a data buffer out of a list of buffers. |
|
JoinedDataBuffer(java.lang.String name,
java.util.List bufferList,
boolean fuse)
Creates a data buffer out of a list of buffers. |
|
JoinedDataBuffer(java.lang.String name,
java.util.List bufferList,
java.util.List idList)
Creates a data buffer out of a list of buffers. |
|
JoinedDataBuffer(java.lang.String name,
java.util.List bufferList,
java.util.List idList,
boolean fuse)
Creates a data buffer out of a list of buffers. |
| Method Summary | |
protected static java.util.List |
assosiateListsWithTypes(java.util.Iterator lists,
java.util.Iterator types)
Creates a ListDataBuffer for each list in given list of lists, and assosiates them with given types. |
boolean |
close()
Dummy implementation. |
DataBuffer[] |
getBuffers()
Gets the underlying data buffers. |
DataValue |
getData(int index)
Gets a specific data element. |
int |
getSize()
Gets the number of data elements in the buffer. |
DataStream |
getStream()
Gets a data stream from the source. |
DataStream |
getStream(boolean reversed)
Gets a data stream from the source. |
protected void |
init(java.lang.String name,
java.util.List bufferList,
java.util.List idList,
boolean fuse)
Initialize this buffer from a list of buffers and ids. |
protected void |
resolveSizeAndType(java.lang.String name,
java.lang.String[] ids,
boolean fuse)
Resolves the joined buffer size and type. |
java.lang.String |
toString()
Gets a buffer string representation. |
java.lang.String |
toString(java.lang.String id,
java.lang.String dataName)
See the DataSource documentation |
| Methods inherited from class com.davisor.data.VoidData |
equals, getDataValue, getType, hashCode, setType |
| 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 DataBuffer[] M_buffers
protected int M_size
protected java.util.Map bufferMetaData
| Constructor Detail |
protected JoinedDataBuffer()
public JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffers - channel buffers
InvalidDataException - if buffers contain invalid elementsJoinedDataBuffer(String,DataBuffer[],String[],boolean),
resolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers,
java.lang.String[] ids)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffers - channel buffersids - channel identifiers (may be null)
InvalidDataException - if buffers contain invalid elementsJoinedDataBuffer(String,DataBuffer[],String[],boolean),
resolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers,
boolean fuse)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffers - channel buffersfuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsJoinedDataBuffer(String,DataBuffer[],String[],boolean),
resolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
DataBuffer[] buffers,
java.lang.String[] ids,
boolean fuse)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffers - channel buffersids - channel identifiers (may be null)fuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsresolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
java.util.List bufferList)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebufferList - a list of channel buffers
InvalidDataException - if buffers contain invalid elementsJoinedDataBuffer(String,List,List,boolean),
resolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
java.util.List bufferList,
java.util.List idList)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebufferList - a list of channel buffersidList - a list of channel identifier strings (may be null)
InvalidDataException - if buffers contain invalid elementsJoinedDataBuffer(String,List,List,boolean),
resolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
java.util.List bufferList,
boolean fuse)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebufferList - a list of channel buffersfuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsJoinedDataBuffer(String,List,List,boolean),
resolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
java.util.List bufferList,
java.util.List idList,
boolean fuse)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebufferList - a list of channel buffersidList - a list of channel identifier strings (may be null)fuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsresolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
java.util.Iterator lists,
java.util.Iterator types,
java.util.List idList,
boolean fuse)
throws InvalidDataException
resolveSizeAndType
method documentation.
name - buffer type namelists - a list of data liststypes - a list of types that describe the content of each data listidList - a list of channel identifier strings (may be null)fuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsresolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
DataBuffer buffer,
java.lang.String bufferID)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffer - first channel data bufferbufferID - first channel identifier
InvalidDataException - if buffers contain invalid elementsresolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
DataBuffer buffer1,
java.lang.String buffer1ID,
DataBuffer buffer2,
java.lang.String buffer2ID,
boolean fuse)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffer1 - first channel data bufferbuffer1ID - first channel identifierbuffer2 - second channel data bufferbuffer2ID - second channel identifierfuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsresolveSizeAndType(java.lang.String, java.lang.String[], boolean)
public JoinedDataBuffer(java.lang.String name,
DataBuffer buffer1,
java.lang.String buffer1ID,
DataBuffer buffer2,
java.lang.String buffer2ID,
DataBuffer buffer3,
java.lang.String buffer3ID,
boolean fuse)
throws InvalidDataException
resolveSizeAndType method documentation.
name - buffer type namebuffer1 - first channel data bufferbuffer1ID - first channel identifierbuffer2 - second channel data bufferbuffer2ID - second channel identifierbuffer3 - third channel data bufferbuffer3ID - third channel identifierfuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementsresolveSizeAndType(java.lang.String, java.lang.String[], boolean)| Method Detail |
public boolean close()
close in interface DataSource
public DataValue getData(int index)
throws com.davisor.core.InvalidIndexException
null values.
If an unexpected error is encountered while fetching data from an
underlying data buffer, this method will immediately recover from
the error by simply setting the corresponding tuple member value
to null value, and printing a verbose error message
to system error log.
getData in interface DataBufferindex - data element index
com.davisor.core.InvalidIndexException - if no data is bound to given indexpublic int getSize()
getSize in interface DataBuffer
public DataStream getStream(boolean reversed)
throws InvalidDataException
getStream in interface DataBufferreversed - controls if stream reads buffer forwards or backwards
InvalidDataException - if a new stream can not be createdJoinedDataStream.JoinedDataStream(DataStream[],TupleType)
public DataStream getStream()
throws InvalidDataException
getStream in interface DataSourceInvalidDataExceptionJoinedDataStream.JoinedDataStream(DataStream[],TupleType)
public java.lang.String toString(java.lang.String id,
java.lang.String dataName)
DataSource documentation
toString in interface DataSourcepublic java.lang.String toString()
Possible meta data fields of 'name' and 'group' are not returned.
toString in class VoidData
protected static final java.util.List assosiateListsWithTypes(java.util.Iterator lists,
java.util.Iterator types)
lists - list of data liststypes - corresponding list of list data typesListDataBuffer.ListDataBuffer(com.davisor.data.Type,java.util.List)
protected void init(java.lang.String name,
java.util.List bufferList,
java.util.List idList,
boolean fuse)
throws InvalidDataException
name - buffer type namebufferList - a list of channel buffersidList - a list of channel identifier strings (may be null)fuse - fuse buffers flag
InvalidDataException
protected final void resolveSizeAndType(java.lang.String name,
java.lang.String[] ids,
boolean fuse)
throws InvalidDataException
If channel identifiers have been explicitly given, then they are
assigned to member types in the order the identifiers appear in
the given identifier table. If the identifier table or some of
it's members are null, then the missing channel
identifiers are taken from member type names. In either case,
the identifier uniqueness is enforced by making sure that no two
identifiers are equal. If they are, the later identifier is given
a running integer index that is appended to the end of the
violating identifier.
If the member buffers contain tuple-elements that are to be fused together, that fusing is done here before the buffers are assigned their final names. Sub-buffer tuple ids are preserved, while single valued buffer ids are taken from the given id argument.
name - buffer type nameids - channel identifiersfuse - fuse buffers flag
InvalidDataException - if buffers contain invalid elementspublic DataBuffer[] getBuffers()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||