net.sf.asyncobjects.io.util
Class RepeatingInput<D extends BatchedData<D>,I extends AInput<D>>

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<I>
      extended by net.sf.asyncobjects.io.util.GeneratingInput<D,I>
          extended by net.sf.asyncobjects.io.util.RepeatingInput<D,I>
Type Parameters:
D - a batched data type
I - a facet type
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AInput<D>
Direct Known Subclasses:
RepeatingByteInput, RepeatingTextInput

public class RepeatingInput<D extends BatchedData<D>,I extends AInput<D>>
extends GeneratingInput<D,I>

An input that repeats specified data over and over. Note that returns some subranges of the supplied batched data, so it never returns more than than lentgh of the supplied data.

Author:
const

Field Summary
 
Fields inherited from class net.sf.asyncobjects.io.util.GeneratingInput
UNLIMITED
 
Constructor Summary
RepeatingInput(D repeatedData)
          A consructor
RepeatingInput(D repeatedData, long toGenerate)
          A consructor
 
Method Summary
protected  D generate(int limit)
          Generate at most limit of the data
 
Methods inherited from class net.sf.asyncobjects.io.util.GeneratingInput
close, generated, isPushbackSupported, pushback, read
 
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer
dereference, export, isImmediate, myVat, promise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.asyncobjects.AsyncObject
dereference, isImmediate
 

Constructor Detail

RepeatingInput

public RepeatingInput(D repeatedData)
A consructor

Parameters:
repeatedData - a data to repeat (must not be null)

RepeatingInput

public RepeatingInput(D repeatedData,
                      long toGenerate)
A consructor

Parameters:
repeatedData - a data to repeat (must not be null)
toGenerate - amount element to generate
Method Detail

generate

protected D generate(int limit)
Description copied from class: GeneratingInput
Generate at most limit of the data

Specified by:
generate in class GeneratingInput<D extends BatchedData<D>,I extends AInput<D>>
Parameters:
limit - a limit on generated data
Returns:
a generated data
See Also:
GeneratingInput.generate(int)


Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.