com.davisor.data.stream
Class EnumeratorTypeStream

java.lang.Object
  extended bycom.davisor.data.VoidData
      extended bycom.davisor.data.stream.EnumeratorDataStream
          extended bycom.davisor.data.stream.EnumeratorTypeStream
All Implemented Interfaces:
Data, DataStream

public class EnumeratorTypeStream
extends EnumeratorDataStream

EnumeratorTypeStream represents an enumerator data stream that enforces the common stream type over all stream elements. In particular, all elements are converted to the stream type before they are returned. The original objects in the stream source are not changed.

Since:
JDK1.1
See Also:
getDataValue(java.lang.Object), EnumeratorTypeStream, Type

Field Summary
 
Fields inherited from class com.davisor.data.stream.EnumeratorDataStream
M_data, M_enumerator, M_index, M_metaData, M_next
 
Fields inherited from class com.davisor.data.VoidData
M_type
 
Fields inherited from interface com.davisor.data.stream.DataStream
INITIAL_INDEX
 
Constructor Summary
EnumeratorTypeStream(java.util.Enumeration enumerator)
          Creates a data stream out of an enumerator.
EnumeratorTypeStream(java.util.Enumeration enumerator, Type type)
          Creates a data stream out of an enumerator and the given type.
 
Method Summary
protected  DataValue getDataValue(java.lang.Object object)
          Makes a data value of the stream type.
 
Methods inherited from class com.davisor.data.stream.EnumeratorDataStream
close, getIndex, hasNext, next
 
Methods inherited from class com.davisor.data.VoidData
equals, getType, hashCode, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.davisor.data.Data
getType
 

Constructor Detail

EnumeratorTypeStream

public EnumeratorTypeStream(java.util.Enumeration enumerator)
                     throws InvalidDataException
Creates a data stream out of an enumerator. The data stream type is taken from the first element in the enumerator

Throws:
InvalidDataException - if the first element is not a DataValue
See Also:
EnumeratorTypeStream(Enumeration,Type)

EnumeratorTypeStream

public EnumeratorTypeStream(java.util.Enumeration enumerator,
                            Type type)
                     throws InvalidDataException
Creates a data stream out of an enumerator and the given type.

Throws:
InvalidDataException - if the collection content does not satisfy the given type.
See Also:
EnumeratorTypeStream(Enumeration)
Method Detail

getDataValue

protected DataValue getDataValue(java.lang.Object object)
                          throws InvalidDataException
Makes a data value of the stream type.

Overrides:
getDataValue in class VoidData
Throws:
InvalidDataException - if the element could not be converted to the current type
See Also:
Type.toData(Object)


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.