org.apache.myfaces.buildtools.maven2.plugin.javascript.uixtools
Class TokenBuffer

java.lang.Object
  extended by org.apache.myfaces.buildtools.maven2.plugin.javascript.uixtools.Queue
      extended by org.apache.myfaces.buildtools.maven2.plugin.javascript.uixtools.TokenBuffer
All Implemented Interfaces:
TokenReader

public class TokenBuffer
extends Queue
implements TokenReader

A buffer to hold Token objects. Tokens can be read from and written to this buffer as if it were a queue. it is thread safe. Best if a single thread is reading and a single thread is writing.

Version:
$Name: $ ($Revision: 606225 $) $Date: 2007-12-21 16:55:00 +0100 (Fr, 21 Dez 2007) $

Constructor Summary
TokenBuffer()
           
TokenBuffer(int bufferSize)
           
 
Method Summary
 Token read()
          reads a Token from this buffer.
 void write(java.io.IOException e)
           
 void write(Token tok)
          This method blocks if the buffer is full.
 
Methods inherited from class org.apache.myfaces.buildtools.maven2.plugin.javascript.uixtools.Queue
add, close, isClosed, isEmpty, isFull, remove, remove, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenBuffer

public TokenBuffer(int bufferSize)
Parameters:
bufferSize - the maximum size of this buffer.

TokenBuffer

public TokenBuffer()
Method Detail

read

public Token read()
           throws java.io.IOException,
                  java.lang.InterruptedException
reads a Token from this buffer. This method blocks until data is available

Specified by:
read in interface TokenReader
Returns:
null if there is no more data and this buffer has been closed.
Throws:
java.io.IOException
java.lang.InterruptedException
See Also:
TokenReader

write

public void write(Token tok)
           throws java.lang.InterruptedException
This method blocks if the buffer is full.

Parameters:
tok - the token to write to this buffer
Throws:
java.lang.InterruptedException

write

public void write(java.io.IOException e)
           throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.