de.hpi.fgis.dude.util.data.storage
Class InputStreamReadable<T extends Jsonable>

java.lang.Object
  extended by de.hpi.fgis.dude.util.data.storage.InputStreamReadable<T>
Type Parameters:
T - The type of instances that shall be read.
All Implemented Interfaces:
JsonReadable<T>

public class InputStreamReadable<T extends Jsonable>
extends Object
implements JsonReadable<T>

InputStreamReadable can be used to read Json data from any InputStream.

Author:
Matthias Pohl

Constructor Summary
InputStreamReadable(Class<T> type, InputStream iStream)
          Initializes an InputStreamReadable with the passed type information.
InputStreamReadable(InputStream iStream)
          Initializes an InputStreamReadable with no type information.
 
Method Summary
 JsonableReader<T> getReader()
          Returns the JsonableReader that can be used to access the content of this DuDeStorage.
 int size()
          Returns the number of instances that are contained.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamReadable

public InputStreamReadable(InputStream iStream)
Initializes an InputStreamReadable with no type information. JsonValue instances will be returned.

Parameters:
iStream - The InputStream from which the data will be read.

InputStreamReadable

public InputStreamReadable(Class<T> type,
                           InputStream iStream)
Initializes an InputStreamReadable with the passed type information.

Parameters:
type - The type that is used for generating the instances.
iStream - The InputStream from which the data will be read.
Method Detail

getReader

public JsonableReader<T> getReader()
Description copied from interface: JsonReadable
Returns the JsonableReader that can be used to access the content of this DuDeStorage.

Specified by:
getReader in interface JsonReadable<T extends Jsonable>
Returns:
The JsonableReader for iterating over the content.

size

public int size()
Description copied from interface: JsonReadable
Returns the number of instances that are contained.

Specified by:
size in interface JsonReadable<T extends Jsonable>
Returns:
The size of this storage.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.