Interface COM.ibm.jaws.mofw.InputEDStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface COM.ibm.jaws.mofw.InputEDStream

public interface InputEDStream
extends Object
InputEDStream is one of the primary mechanisms used in the object server. InputEDStream comes in many subclasses with special constructors, methods, and internal representations. An InputEDStream can be very light-weight (e.g., a sequence of three values) or very complex (e.g., an iterator over all the Managed objects in a large database). This interface is similar to the CORBA StreamIO interface. It differs mainly in that Java has fewer atomic types than CORBA.

In OOD terms, an InputEDStream is the MOFW representation of a "source" process and dataflow that generates data in a form accepted by some other dataflow or process. In this case the canonical form consists the MOFW datatypes.

These methods each throw a EDStreamFormatError. Like other Java Errors, they do not require the client to either use the catch/throw mechanism or require a throws in the implementation of the method.

It is always the responsibility of the client of a InputEDStream to know what order to read from the InputEDStream.


Method Index

 o atEnd()
Use this method to determine if the stream is currently at an end marker or the true end of stream.
 o readBegin()
Use this method to begin reading a variable length sequence from this stream.
 o readBoolean()
Use this method to read a boolean from the stream.
 o readByte()
Use this method to read an uninterpreted byte from this stream.
 o readChar()
Use this method to read a char from this stream.
 o readDouble()
Use this method to read a double from this stream.
 o readEnd()
Use this method to consume stream entries up to and including the next end marker or the true end of stream (if no intermediate marker is reached).
 o readFloat()
Use this method to read a float from this stream.
 o readInt()
Use this method to read an int from this stream.
 o readLong()
Use this method to read a long from this stream.
 o readManageable()
Use readManageable() and writeManageable() when you want to write the object's EssentialData and not preserve its identity.
 o readManaged(BaseCollection)
Use writeManaged() and readManaged() when you want identity to be preserved.
 o readObject()
Use readObject() and writeObject() when you want the stream to handle

Methods

 o atEnd
  public abstract boolean atEnd()
Use this method to determine if the stream is currently at an end marker or the true end of stream. The marker is not "consumed."
 o readBegin
  public abstract void readBegin() throws EDStreamFormatError
Use this method to begin reading a variable length sequence from this stream. The expectation is that a begin marker is in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a begin marker.
 o readEnd
  public abstract void readEnd()
Use this method to consume stream entries up to and including the next end marker or the true end of stream (if no intermediate marker is reached).
 o readBoolean
  public abstract boolean readBoolean() throws EDStreamFormatError
Use this method to read a boolean from the stream.
Returns:
the boolean repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a boolean.
 o readByte
  public abstract byte readByte() throws EDStreamFormatError
Use this method to read an uninterpreted byte from this stream. For CORBA compliance we may need to change this to readOctet (or add a method).
Returns:
the byte repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a byte.
 o readShort
  public abstract short readShort() throws EDStreamFormatError
Use this method to read a short from this stream.
Returns:
the short repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a short.
 o readInt
  public abstract int readInt() throws EDStreamFormatError
Use this method to read an int from this stream.
Returns:
the int repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a int.
 o readLong
  public abstract long readLong() throws EDStreamFormatError
Use this method to read a long from this stream.
Returns:
the long repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not an long.
 o readFloat
  public abstract float readFloat() throws EDStreamFormatError
Use this method to read a float from this stream.
Returns:
the float repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a float.
 o readDouble
  public abstract double readDouble() throws EDStreamFormatError
Use this method to read a double from this stream.
Returns:
the double repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a double.
 o readChar
  public abstract char readChar() throws EDStreamFormatError
Use this method to read a char from this stream.
Returns:
the char repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a char.
 o readString
  public abstract String readString() throws EDStreamFormatError
Use this method to read a string from this stream.
Returns:
the string repesenting the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not a string.
 o readObject
  public abstract Object readObject() throws EDStreamFormatError
Use readObject() and writeObject() when you want the stream to handle
Returns:
the Object that is the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not an object of the (optionally) specified type.
 o readManageable
  public abstract Manageable readManageable() throws EDStreamFormatError
Use readManageable() and writeManageable() when you want to write the object's EssentialData and not preserve its identity. This method should handle the following cases: In all cases, a writeManageable() and subsequent readManageable() will create a new object with the same EssentialData.
Returns:
the Manageable object that is the next item in the stream.
Throws: EDStreamFormatError
is raised when the OutputEDStream expects something other than an object of the type passed in.
 o readManaged
  public abstract Managed readManaged(BaseCollection relativeTo) throws EDStreamFormatError
Use writeManaged() and readManaged() when you want identity to be preserved. That is, if the Managed object is already in memory, then that object is found instead of creating a new copy. This implies that enough of the object's Identifier must be included in the stream to ensure single-copy semantics. Whether the state of the Managed object is included in the stream, via externalizeToStream() and internalizeFromStream(), is up to the stream implementation. This allows (but does not require) multiple objects to be included in the same stream as performance dictates.

In the following code, Managed foo, bar; myStream.writeManaged(foo); bar = myStream.readManaged(); boolean identical = foo.isIdentical(bar); the boolean identical is true.

These methods should be contrasted with writeManageable() and readManageable(), which only preserve equality. In the following code, Manageable foo, bar; myStream.writeManageable(foo); bar = myStream.readManageable(); boolean identical = foo.isIdentical(bar); boolean equal = foo.equals(bar); the boolean identical is false and the boolean equal is true.

This method should support at least the following types:

Parameters:
relativeTo - determines how much of the Identifier is included in the stream. If null, the stream may use its root BaseCollection or may throw an exception. The relativeTo for a corresponding pair of writeManaged() and readManaged() should be the same.
Returns:
the Managed that is the next item in the stream.
Throws: EDStreamFormatError
is raised when the next item in the InputEDStream is not an Managed object of the (optionally) specified type.

All Packages  Class Hierarchy  This Package  Previous  Next  Index