org.shapelogic.streams
Class NamedNumberedStreamLazySetup<E>

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

Deprecated.

@Deprecated
public class NamedNumberedStreamLazySetup<E>
extends java.lang.Object
implements NumberedStream<E>, SetupFlagged

Get a Named Stream out of the context.
With lazy setup, so the input stream is only found when you start to use the values in the stream.
Last resort to get a reference to a stream that is not yet available.
Currently not used hence it is deprecated, but it could be useful.

Author:
Sami Badawi

Field Summary
protected  NumberedStream<E> _inputStream
          Deprecated.  
protected  java.lang.String _name
          Deprecated.  
protected  boolean _setup
          Deprecated.  
 
Constructor Summary
NamedNumberedStreamLazySetup(java.lang.String name)
          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.
 int getLast()
          Deprecated. Last possible element.
 int getMaxLast()
          Deprecated. Manually set max value for last possible element.
 java.lang.String getName()
          Deprecated. Not sure if Name is the best choice.
 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
 boolean isSetup()
          Deprecated.  
 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

_name

protected java.lang.String _name
Deprecated. 

_inputStream

protected NumberedStream<E> _inputStream
Deprecated. 

_setup

protected boolean _setup
Deprecated. 
Constructor Detail

NamedNumberedStreamLazySetup

public NamedNumberedStreamLazySetup(java.lang.String name)
Deprecated. 
Method Detail

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>
Specified by:
setup in interface SetupFlagged

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>

isSetup

public boolean isSetup()
Deprecated. 
Specified by:
isSetup in interface SetupFlagged

getName

public java.lang.String getName()
Deprecated. 
Not sure if Name is the best choice.



Copyright © 2009. All Rights Reserved.