org.shapelogic.streams
Class NamedNumberedStream<E>

java.lang.Object
  extended by org.shapelogic.streams.NamedNumberedStream<E>
All Implemented Interfaces:
java.util.Iterator<E>, CalcValue<E>, LazyCalc<E>, NumberedStream<E>, Stream<E>

Deprecated.

@Deprecated
public class NamedNumberedStream<E>
extends java.lang.Object
implements NumberedStream<E>

Get a Named Stream out of the context.

The idea is that there should be a stream already and this will create a thin wrapper around it, so now there will be an extra stream, this serves no purpose.

Use factory method StreamFactory.findNumberedStream(String name) instead.

Author:
Sami Badawi

Field Summary
protected  NumberedStream<E> _inputStream
          Deprecated.  
protected  java.lang.String _key
          Deprecated.  
 
Constructor Summary
NamedNumberedStream(java.lang.String key)
          Deprecated. 
 
Method Summary
 E get(int input)
          Deprecated. Get the calculate value for index based on the previous stream.
 int getIndex()
          Deprecated. Index of last successfully processed element.
static NumberedStream getInstance(java.lang.String key)
          Deprecated.  
 int getLast()
          Deprecated. Last possible element.
 int getMaxLast()
          Deprecated. Manually set max value for last possible element.
 E getValue()
          Deprecated. Starts a lazy calculation.
 boolean hasNext()
          Deprecated.  
 boolean isDirty()
          Deprecated. When dirty is false that means that the calculated value can be used
 E next()
          Deprecated.  
 void remove()
          Deprecated.  
 void setMaxLast(int maxLast)
          Deprecated. Set a max value for last possible element.
 void setup()
          Deprecated. Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_key

protected java.lang.String _key
Deprecated. 

_inputStream

protected NumberedStream<E> _inputStream
Deprecated. 
Constructor Detail

NamedNumberedStream

@Deprecated
public NamedNumberedStream(java.lang.String key)
Deprecated. 

Method Detail

getInstance

public static NumberedStream getInstance(java.lang.String key)
Deprecated. 

get

public E get(int input)
Deprecated. 
Description copied from interface: NumberedStream
Get the calculate value for index based on the previous stream.

So it just calls invoke(getInputStream().get(index), index)

Specified by:
get in interface NumberedStream<E>
Returns:

getIndex

public int getIndex()
Deprecated. 
Description copied from interface: NumberedStream
Index of last successfully processed element.

Specified by:
getIndex in interface NumberedStream<E>

getLast

public int getLast()
Deprecated. 
Description copied from interface: NumberedStream
Last possible element.
If last is not known then this is set to LAST_UNKNOWN.
When you add a new element this will not grow.
When maxLast is set so it this, but this can can get lower.
Set when you find the end.

If you use this for iteration you need to call the function at each iteration.

Specified by:
getLast in interface NumberedStream<E>

getMaxLast

public int getMaxLast()
Deprecated. 
Description copied from interface: NumberedStream
Manually set max value for last possible element.

Specified by:
getMaxLast in interface NumberedStream<E>

setMaxLast

public void setMaxLast(int maxLast)
Deprecated. 
Description copied from interface: NumberedStream
Set a max value for last possible element.

Specified by:
setMaxLast in interface NumberedStream<E>

isDirty

public boolean isDirty()
Deprecated. 
Description copied from interface: LazyCalc
When dirty is false that means that the calculated value can be used

Specified by:
isDirty in interface LazyCalc<E>

setup

public void setup()
Deprecated. 
Description copied from interface: LazyCalc
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.

Specified by:
setup in interface LazyCalc<E>

getValue

public E getValue()
Deprecated. 
Description copied from interface: CalcValue
Starts a lazy calculation. If dirty do calc() else return cached value. This should maybe be moved up in the hierarchy

Specified by:
getValue in interface CalcValue<E>

hasNext

public boolean hasNext()
Deprecated. 
Specified by:
hasNext in interface java.util.Iterator<E>

next

public E next()
Deprecated. 
Specified by:
next in interface java.util.Iterator<E>

remove

public void remove()
Deprecated. 
Specified by:
remove in interface java.util.Iterator<E>


Copyright © 2008. All Rights Reserved.