de.grogra.util
Class OutputQueue

java.lang.Object
  extended by java.io.OutputStream
      extended by de.grogra.util.OutputQueue
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable
Direct Known Subclasses:
HierarchicalQueue

public class OutputQueue
extends java.io.OutputStream
implements java.io.DataOutput

This class represents a queue of byte, int, long, float, double, and Object-values. For each type, a separate list is stored.

Author:
Ole Kniemeyer

Constructor Summary
OutputQueue(boolean usesObjectQueue)
          Creates a new OutputQueue.
 
Method Summary
 void clear()
           
 void close()
           
 void dump(java.io.PrintStream out)
           
 void flush()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeBoolean(boolean v)
           
 void writeByte(int v)
           
 void writeBytes(java.lang.String s)
           
 void writeChar(int v)
           
 void writeChars(java.lang.String s)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeObject(java.lang.Object v)
           
 void writeObjectInQueue(java.lang.Object v)
           
 void writeShort(int v)
           
 void writeUTF(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputQueue

public OutputQueue(boolean usesObjectQueue)
Creates a new OutputQueue.

Parameters:
usesObjectQueue - true iff the queue of type Object will be used
Method Detail

clear

public void clear()

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream

dump

public void dump(java.io.PrintStream out)

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream

write

public final void write(byte[] b)
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class java.io.OutputStream

write

public final void write(byte[] b,
                        int off,
                        int len)
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class java.io.OutputStream

write

public final void write(int b)
Specified by:
write in interface java.io.DataOutput
Specified by:
write in class java.io.OutputStream

writeBoolean

public final void writeBoolean(boolean v)
Specified by:
writeBoolean in interface java.io.DataOutput

writeByte

public final void writeByte(int v)
Specified by:
writeByte in interface java.io.DataOutput

writeBytes

public final void writeBytes(java.lang.String s)
Specified by:
writeBytes in interface java.io.DataOutput

writeChar

public final void writeChar(int v)
Specified by:
writeChar in interface java.io.DataOutput

writeChars

public final void writeChars(java.lang.String s)
Specified by:
writeChars in interface java.io.DataOutput

writeDouble

public final void writeDouble(double v)
Specified by:
writeDouble in interface java.io.DataOutput

writeFloat

public final void writeFloat(float v)
Specified by:
writeFloat in interface java.io.DataOutput

writeInt

public final void writeInt(int v)
Specified by:
writeInt in interface java.io.DataOutput

writeLong

public final void writeLong(long v)
Specified by:
writeLong in interface java.io.DataOutput

writeObject

public void writeObject(java.lang.Object v)
                 throws java.io.IOException
Throws:
java.io.IOException

writeObjectInQueue

public final void writeObjectInQueue(java.lang.Object v)

writeShort

public final void writeShort(int v)
Specified by:
writeShort in interface java.io.DataOutput

writeUTF

public final void writeUTF(java.lang.String s)
Specified by:
writeUTF in interface java.io.DataOutput