com.sun.media
类 CircularBuffer

java.lang.Object
  继承者 com.sun.media.CircularBuffer

public class CircularBuffer
extends java.lang.Object

CircularQueue It implements a circular FIFO queue of references to Objects.


构造方法摘要
CircularBuffer(int n)
          create a queue with max number of elements
 
方法摘要
 boolean canRead()
          returns true if read() would succeed
 boolean canWrite()
          returns true if getEmptyObject() would succeed
 void error()
          error dump
 Buffer getEmptyBuffer()
          returns empty buffer object to put data in
 boolean lockedRead()
           
 boolean lockedWrite()
           
 Buffer peek()
          Gets frame with valid buffer from the queue
 void print()
           
 Buffer read()
          Gets frame with valid buffer from the queue
 void readReport()
          indicates that the latest read frame is no longer in use
 void reset()
          reset the queue
 void writeReport()
          indicates that latest Object returns to the queue
we removed writeReport(false), since we have the mechanism in javax.media.Buffer (discard).
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

CircularBuffer

public CircularBuffer(int n)
create a queue with max number of elements

参数:
n - the max number of elements
方法详细信息

readReport

public void readReport()
indicates that the latest read frame is no longer in use


canRead

public boolean canRead()
returns true if read() would succeed


lockedRead

public boolean lockedRead()

lockedWrite

public boolean lockedWrite()

read

public Buffer read()
Gets frame with valid buffer from the queue


peek

public Buffer peek()
Gets frame with valid buffer from the queue


writeReport

public void writeReport()
indicates that latest Object returns to the queue
we removed writeReport(false), since we have the mechanism in javax.media.Buffer (discard).


getEmptyBuffer

public Buffer getEmptyBuffer()
returns empty buffer object to put data in


canWrite

public boolean canWrite()
returns true if getEmptyObject() would succeed


error

public void error()
error dump


print

public void print()

reset

public void reset()
reset the queue