net.sf.asyncobjects.io
Interface BatchedData<D extends BatchedData<D>>

Type Parameters:
D - an actual type
All Superinterfaces:
Comparable<D>
All Known Implementing Classes:
BinaryData, TextData

public interface BatchedData<D extends BatchedData<D>>
extends Comparable<D>

A batched data interface. This interface contains operations that are common to BinaryData and TextData classes. It is used to provide a common IO code.

Author:
const

Method Summary
 D concat(D data)
          Concatenage two items
 D drop(int n)
          Get new data with first n elements dropped
 D head(int n)
          Get data with first n elements
 boolean isEmpty()
           
 int length()
           
 Promise<D> promise()
          Return a promise that wraps this value
 D subrange(int start, int end)
          Get subrange of data
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

concat

D concat(D data)
Concatenage two items

Parameters:
data - a second element
Returns:
this data concatenatd with provided data.

drop

D drop(int n)
Get new data with first n elements dropped

Parameters:
n - cut point
Returns:
data after position

head

D head(int n)
Get data with first n elements

Parameters:
n - amount to cut from beginning of the data
Returns:
data with first n bytes of the data

subrange

D subrange(int start,
           int end)
Get subrange of data

Parameters:
start - a start posiion
end - a limit
Returns:
a data that represents subrange

isEmpty

boolean isEmpty()
Returns:
true if data is empty

length

int length()
Returns:
length of data

promise

Promise<D> promise()
Return a promise that wraps this value

Returns:
a promise


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.