com.monica.javacom.streams
Class MJCWriteableHasAOS

java.lang.Object
  |
  +--com.monica.javacom.streams.MJCWriteableHasAOS
All Implemented Interfaces:
MJCWriteable

public class MJCWriteableHasAOS
extends java.lang.Object
implements MJCWriteable

Class for creating a link between an OutputStream and the MJC layer hierarchy. This class acts as a MJCWriteable, this means an upper layer can write to it, and what has been written on it, will be written again to the OutputStream given. The writing to the OutputStream is buffered.


Constructor Summary
MJCWriteableHasAOS(java.io.OutputStream os)
          Constructor.
 
Method Summary
 void flush()
          Flushes the conents of the buffer to the OutputStream.
 java.lang.String getLastWriteableError()
          Returns the description of the last occured error.
 java.lang.String getWriteableName()
          Returns the MJC name of the MJCWriteable.
 java.lang.String getWriteableVersion()
          Returns the MJC version of the MJCWriteable.
 boolean isWriteableConnected()
          Returns wether this MJCWriteable object is still connected to the OutputStream, that means, wether this object can still write to the OutputStream.
 boolean write(char c)
          Writes a single char (0...255) to the OutputStream.
 boolean write(char[] c)
          Writes an array of chars to the OutputStream.
 boolean write(java.lang.String s)
          Writes a String to the OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MJCWriteableHasAOS

public MJCWriteableHasAOS(java.io.OutputStream os)
Constructor.
Parameters:
OutputStream - os: the specified OutputStream to which the data has to be written
Method Detail

getWriteableName

public java.lang.String getWriteableName()
Returns the MJC name of the MJCWriteable.
Specified by:
getWriteableName in interface MJCWriteable
Returns:
String: the MJC name of the MJCWriteable

getWriteableVersion

public java.lang.String getWriteableVersion()
Returns the MJC version of the MJCWriteable.
Specified by:
getWriteableVersion in interface MJCWriteable
Returns:
String: the MJC version of the MJCWriteable

write

public boolean write(char c)
Writes a single char (0...255) to the OutputStream. Writing to the OutputStream is buffered.
Specified by:
write in interface MJCWriteable
Parameters:
char - c: the char to be written to the OutputStream
Returns:
boolean: wether the writing has been successful

write

public boolean write(java.lang.String s)
Writes a String to the OutputStream. Writing to the OutputStream is buffered.
Specified by:
write in interface MJCWriteable
Parameters:
String - s: the String to be written to the OutputStream
Returns:
boolean: wether the writing has been successful

write

public boolean write(char[] c)
Writes an array of chars to the OutputStream. Writing to the OutputStream is buffered.
Specified by:
write in interface MJCWriteable
Parameters:
char[] - c: the char array to be written to the OutputStream
Returns:
boolean: wether the writing has been successful

flush

public void flush()
Flushes the conents of the buffer to the OutputStream.
Specified by:
flush in interface MJCWriteable

getLastWriteableError

public java.lang.String getLastWriteableError()
Returns the description of the last occured error. Once queried, the errormessage will be deleted.
Specified by:
getLastWriteableError in interface MJCWriteable
Returns:
String: the error description of the error that occured since the last query

isWriteableConnected

public boolean isWriteableConnected()
Returns wether this MJCWriteable object is still connected to the OutputStream, that means, wether this object can still write to the OutputStream.
Specified by:
isWriteableConnected in interface MJCWriteable
Returns:
boolean: wether this object is connected to its OutputStream