org.shapelogic.streams
Class NamedListStream<E>

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

Deprecated.

@Deprecated
public class NamedListStream<E>
extends java.lang.Object
implements ListStream<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.

Author:
Sami Badawi

Field Summary
protected  ListStream<E> _inputStream
          Deprecated.  
protected  java.lang.String _key
          Deprecated.  
 
Constructor Summary
NamedListStream(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.
 int getLast()
          Deprecated. Last possible element.
 java.util.List<E> getList()
          Deprecated. Get underlying list.
 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
 java.util.Iterator<E> iterator()
          Deprecated.  
 E next()
          Deprecated.  
 void remove()
          Deprecated.  
 void setList(java.util.List<E> list)
          Deprecated. Get underlying list.
 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 ListStream<E> _inputStream
Deprecated. 
Constructor Detail

NamedListStream

@Deprecated
public NamedListStream(java.lang.String key)
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>

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>

getList

public java.util.List<E> getList()
Deprecated. 
Description copied from interface: ListStream
Get underlying list.

Specified by:
getList in interface ListStream<E>

setList

public void setList(java.util.List<E> list)
Deprecated. 
Description copied from interface: ListStream
Get underlying list.

Specified by:
setList in interface ListStream<E>

iterator

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


Copyright © 2009. All Rights Reserved.