|
|||||||||||
| 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.CollectionDataSource
com.davisor.data.stream.ListDataBuffer
ListDataBuffer represents a data buffer that uses a standard Java list to implement a buffer of DataValue elements. The buffer also exposes the underlying list object to allow direct list content manipulation.
A data buffer has a data type that may be used to convert elements into one uniform type when data is inserted into the collection. However, arbitrary data may be also be placed directly into the collection. Data streams that read this buffer may later apply additional type conversions.
getList(),
CollectionDataSource.getStream(),
Type| Field Summary |
| Fields inherited from class com.davisor.data.stream.CollectionDataSource |
M_collection |
| Fields inherited from class com.davisor.data.VoidData |
M_type |
| Constructor Summary | |
ListDataBuffer()
Default constructor that creates an empty collection with no type. |
|
ListDataBuffer(DataStream stream)
Creates a list data buffer from the content of the given stream. |
|
ListDataBuffer(java.util.List list)
Creates a list data buffer from the given list. |
|
ListDataBuffer(java.lang.Object[] collection)
Creates a list data buffer out of the given array. |
|
ListDataBuffer(java.lang.Object[] collection,
Type type)
Creates a list data buffer out of the given array and type. |
|
ListDataBuffer(Type type)
Creates an empty Vector based list data buffer that
is expected to later contain elements of the given type. |
|
ListDataBuffer(Type type,
DataStream stream)
Creates a list data buffer from the content of the given stream, with stream elements type casted to the given type, if neccessary. |
|
ListDataBuffer(Type type,
java.util.List list)
Creates a list data buffer from the given list and element type. |
|
ListDataBuffer(Type type,
java.lang.String buffer)
Interpreters a string as a list of elements of the given type, separated by space characters. |
|
ListDataBuffer(Type type,
java.lang.String buffer,
char separator)
Interpreters a string as a list of elements of the given type, separated by given separator characters. |
|
| Method Summary | |
DataValue |
getData(int index)
Gets the specific data element. |
java.util.List |
getList()
Gets the underlying list. |
int |
getSize()
Gets the number of data in the buffer. |
DataStream |
getStream(boolean reversed)
Gets a new data stream from the data source. |
| Methods inherited from class com.davisor.data.stream.CollectionDataSource |
addAll, close, getCollection, getStream, setType, toString, toString |
| Methods inherited from class com.davisor.data.VoidData |
equals, getDataValue, getType, hashCode |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.davisor.data.stream.DataSource |
close, getStream, toString |
| Methods inherited from interface com.davisor.data.Data |
getType |
| Constructor Detail |
public ListDataBuffer()
public ListDataBuffer(Type type)
Vector based list data buffer that
is expected to later contain elements of the given type.
type - type of buffer elements
public ListDataBuffer(java.lang.Object[] collection)
throws InvalidDataException
collection - buffer elements
InvalidDataException - if the type of the first element
cannot be determinedListDataBuffer(List)
public ListDataBuffer(java.lang.Object[] collection,
Type type)
collection - buffer elementstype - type of buffer elementsListDataBuffer(Type,List)
public ListDataBuffer(java.util.List list)
throws InvalidDataException
AutoType. This is probably
not what you want.
list - buffer elements
InvalidDataException - if the type of the first element
cannot be determinedListDataBuffer(Type,List),
CollectionDataSource.setType(com.davisor.data.Type)
public ListDataBuffer(Type type,
java.util.List list)
type - type of buffer elementslist - buffer elements
public ListDataBuffer(DataStream stream)
throws InvalidDataException
stream - input stream to be consumed
InvalidDataException - if the stream contains invalid data
public ListDataBuffer(Type type,
DataStream stream)
throws InvalidDataException
type - type of buffer elementsstream - input stream to be consumed
InvalidDataException - if the stream contains invalid data
public ListDataBuffer(Type type,
java.lang.String buffer)
throws InvalidDataException
type - type of buffer elementsbuffer - input buffer to be read
InvalidDataException - if buffer contains invalid dataListDataBuffer(Type,String,char)
public ListDataBuffer(Type type,
java.lang.String buffer,
char separator)
throws InvalidDataException
type - type of buffer elementsbuffer - input buffer to be read (may be null)separator - element separator
InvalidDataException - if buffer contains invalid data| Method Detail |
public DataValue getData(int index)
throws com.davisor.core.InvalidIndexException
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 createdListIteratorDataStream.ListIteratorDataStream(List,Type,boolean)public java.util.List getList()
CollectionDataSource.getCollection()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||