com.davisor.data.stream
Class DataBuffers

java.lang.Object
  extended bycom.davisor.data.stream.DataBuffers

public class DataBuffers
extends java.lang.Object

DataBuffers provides tools for DataBuffer manipulation.

Since:
JDK1.1
See Also:
Type

Constructor Summary
DataBuffers()
           
 
Method Summary
static DataBuffer removeNulls(DataBuffer buffer)
          Copies non-null buffer elements into a new list data buffer.
static DataBuffer[] toListBuffers(DataBuffer buffer)
          Copies given data buffer column content into corresponding list data buffers.
static java.util.List[] toLists(DataBuffer buffer)
          Copies given data buffer column content into corresponding lists.
static DataBuffer[] toProxyBuffers(DataBuffer buffer)
          Creates proxy buffers giving single column views to corresponding columns in given data buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBuffers

public DataBuffers()
Method Detail

toListBuffers

public static DataBuffer[] toListBuffers(DataBuffer buffer)
                                  throws InvalidDataException
Copies given data buffer column content into corresponding list data buffers.

Parameters:
buffer - buffer to copy content from
Returns:
as many new list data buffers as the buffer contains columns, filled with data
Throws:
InvalidDataException - if buffer content access fails
See Also:
toLists(com.davisor.data.stream.DataBuffer), toProxyBuffers(com.davisor.data.stream.DataBuffer)

toLists

public static java.util.List[] toLists(DataBuffer buffer)
                                throws InvalidDataException
Copies given data buffer column content into corresponding lists.

Parameters:
buffer - buffer to copy content from
Returns:
as many new lists as the buffer contains columns, filled with data
Throws:
InvalidDataException - if buffer content access fails
See Also:
toListBuffers(com.davisor.data.stream.DataBuffer)

toProxyBuffers

public static DataBuffer[] toProxyBuffers(DataBuffer buffer)
                                   throws InvalidDataException,
                                          com.davisor.core.InvalidIndexException
Creates proxy buffers giving single column views to corresponding columns in given data buffer. Unlike toListBuffers(com.davisor.data.stream.DataBuffer), this method does not copy buffer content, but creates tools that just transparently access data in given data buffer.

If the given buffer has already a single simple type column (not of TupleType), the buffer is returned as it is in a single slot array. Otherwise an array of ProxyDataBuffer objects is created and returned.

Parameters:
buffer - source data buffer
Returns:
a number of data buffers equal to columns in the source buffer
Throws:
InvalidDataException - if buffer type resolvation fails
com.davisor.core.InvalidIndexException - if buffer column access fails
See Also:
ProxyDataBuffer, toListBuffers(com.davisor.data.stream.DataBuffer)

removeNulls

public static DataBuffer removeNulls(DataBuffer buffer)
                              throws InvalidDataException
Copies non-null buffer elements into a new list data buffer.

Parameters:
buffer - buffer to copy
Returns:
a new list data buffer containing only non-null elements
Throws:
InvalidDataException - if buffer content access fails


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.