scone.util.tokenstream
Class TokenBuffer

java.lang.Object
  extended by scone.util.tokenstream.TokenBuffer

public class TokenBuffer
extends java.lang.Object

A Buffer to store Tokens.
Just do not mess with this class

Version:
1.0
Author:
Volkert Buchmann (ported from code by Steve Ihde), IBM Almaden Research Center, (c) Copyright IBM Corp 2000

Nested Class Summary
 class TokenBuffer.CircularTokenStore
           
 
Constructor Summary
TokenBuffer(int capacity)
           
TokenBuffer(Token[] source)
           
 
Method Summary
 int available(java.lang.Object context)
           
 void done()
           
 void doneReading()
           
 void finalize()
           
 AbortEvent getAbortEvent()
           
 long getMark(java.lang.Object subscription)
           
 long getOffset(java.lang.Object context)
           
 void handleAbort(AbortEvent ae)
           
 boolean isAborted()
           
 boolean isDone()
           
 boolean isDoneReading()
           
 void mark(java.lang.Object subscription, int readlimit)
           
 boolean markSupported()
           
 void preserveMark(java.lang.Object subscription)
           
 int read(Token[] buf, int offset, int size, java.lang.Object context, long timeout, boolean peek)
           
 void reset(java.lang.Object subscription)
           
 java.lang.Object subscribe()
           
 java.lang.Object subscribe(java.lang.Object other)
           
 void unmark(java.lang.Object subscription)
           
 void unsubscribe(java.lang.Object subscription)
           
 int write(Token[] buf, int offset, int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenBuffer

public TokenBuffer(int capacity)

TokenBuffer

public TokenBuffer(Token[] source)
Method Detail

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

subscribe

public java.lang.Object subscribe()

subscribe

public java.lang.Object subscribe(java.lang.Object other)

unsubscribe

public void unsubscribe(java.lang.Object subscription)

mark

public void mark(java.lang.Object subscription,
                 int readlimit)

reset

public void reset(java.lang.Object subscription)
           throws java.io.IOException
Throws:
java.io.IOException

preserveMark

public void preserveMark(java.lang.Object subscription)
                  throws java.io.IOException
Throws:
java.io.IOException

markSupported

public boolean markSupported()

getMark

public long getMark(java.lang.Object subscription)
             throws java.io.IOException
Throws:
java.io.IOException

unmark

public void unmark(java.lang.Object subscription)

read

public int read(Token[] buf,
                int offset,
                int size,
                java.lang.Object context,
                long timeout,
                boolean peek)
         throws AbortIOException,
                java.io.InterruptedIOException,
                MarkPreservedException
Throws:
AbortIOException
java.io.InterruptedIOException
MarkPreservedException

write

public int write(Token[] buf,
                 int offset,
                 int size)
          throws scone.util.tokenstream.TokenBufferClosedException,
                 AbortIOException
Throws:
scone.util.tokenstream.TokenBufferClosedException
AbortIOException

done

public void done()

isDone

public boolean isDone()

doneReading

public void doneReading()

isDoneReading

public boolean isDoneReading()

available

public int available(java.lang.Object context)

handleAbort

public void handleAbort(AbortEvent ae)

isAborted

public boolean isAborted()

getAbortEvent

public AbortEvent getAbortEvent()

getOffset

public long getOffset(java.lang.Object context)