|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.data.stream.IndirectDataBuffer
com.davisor.data.stream.ProxyDataBuffer
ProxyDataBuffer provides a single column view to a multi column
buffer. A multi column buffer is any buffer that contains TupleData elements.
The proxy source data buffer and target tuple member are set at proxy construction time, and from there on the proxy buffer behaves like a buffer that would contain only one column.
The connection to the source data buffer is live in that sense that any changes made to the source data buffer affect the results returned by this proxy immediately. In particular, applications must take care of appropriate synchronization issues by themselves.
If the proxy source data buffer in an instance of JoinedDataBuffer, all proxy operations will access the target
joined data buffer member buffer directly. If the source data
buffer is some other implementation, proxy operations will first
access the main buffer, and then only operation one of the main
buffer tuple elements. Please note, that these two cases represent
column-first and row-first data table arrangements, respectively.
| Nested Class Summary | |
class |
ProxyDataBuffer.ProxyDataStream
ProxyDataStream implements a single column view to a multi column stream. |
| Field Summary | |
protected int |
M_memberIndex
The index of the member this proxy refers to. |
static int |
NONE
Member index value to indicate access to the the whole element. |
| Fields inherited from class com.davisor.data.stream.IndirectDataBuffer |
M_dataBuffer |
| Constructor Summary | |
ProxyDataBuffer(DataBuffer dataBuffer,
int memberIndex)
Creates a new proxy data buffer. |
|
| Method Summary | |
DataValue |
getData(int index)
Gets the specific data element from the data buffer. |
DataStream |
getStream()
Gets a new data stream from the data source. |
DataStream |
getStream(boolean reversed)
Gets a new data stream from the data source. |
Type |
getType()
Gets the type of this data object. |
java.lang.String |
toString(java.lang.String id,
java.lang.String dataName)
Returns a String representation of the DataSource. |
| Methods inherited from class com.davisor.data.stream.IndirectDataBuffer |
close, equals, getSize, hashCode, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NONE
protected int M_memberIndex
| Constructor Detail |
public ProxyDataBuffer(DataBuffer dataBuffer,
int memberIndex)
throws com.davisor.core.InvalidIndexException
JoinedDataBuffer instance, this proxy will access one
of the joined data buffer member buffers directly. Otherwise
the proxy will access the whole buffer, but operate on given
member element only.
If given member index is NONE, the proxy will always access the whole element, and therefore act as an extra no-operation layer on top of given buffer. In particular, this will allow the proxy to operate on single column buffers, too, that use simple data values instead of tuple data values.
In order to support lazy buffer content evaluation, given buffer access is minimized at this time. This means also that buffer validity is not fully checked. Instead, if the buffer type or content is invalid in some sense, this will cause runtime exceptions later when the buffer is actually referenced.
dataBuffer - proxy source data buffermemberIndex - source tuple data target member index (may be NONE)
com.davisor.core.InvalidIndexException - if there is no such member in given buffer
java.lang.NullPointerException - if the given data buffer is null| Method Detail |
public Type getType()
throws InvalidDataException
getType in interface DatagetType in class IndirectDataBufferjava.lang.ClassCastException - if a target type could not be resolved
InvalidDataException - if type retrieval fails
java.lang.NullPointerException - if the source buffer is nullData.getType()
public DataValue getData(int index)
throws com.davisor.core.InvalidIndexException
getData in interface DataBuffergetData in class IndirectDataBufferindex - data element index
com.davisor.core.InvalidIndexException - if no data is bound to given index
java.lang.NullPointerException - if the source buffer is null
public DataStream getStream(boolean reversed)
throws InvalidDataException
getStream in interface DataBuffergetStream in class IndirectDataBufferreversed - controls if stream reads buffer forwards or backwards
InvalidDataException - if a new stream can not be created
java.lang.NullPointerException - if the source buffer is null
public DataStream getStream()
throws InvalidDataException
getStream in interface DataSourcegetStream in class IndirectDataBufferInvalidDataException - if a new stream can not be created
java.lang.NullPointerException - if the source buffer is null
public java.lang.String toString(java.lang.String id,
java.lang.String dataName)
toString in interface DataSourcetoString in class IndirectDataBufferjava.lang.NullPointerException - if the source buffer is null
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||