public class Fifo
extends java.lang.Object
Constructor and Description |
---|
Fifo()
Create a buffer with a default initial size.
|
Fifo(int initialSlots)
Create a buffer with a specified initial size.
|
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flush all entries from the buffer.
|
void |
insert(java.lang.Object obj)
Insert an entry into the buffer.
|
boolean |
isEmpty()
Check if the buffer has an entries or not.
|
java.lang.Object |
remove()
Remove an entry from the buffer if one is available.
|
int |
size()
Return the number of entries currently in the fifo.
|
public Fifo()
public Fifo(int initialSlots)
initialSlots
- The number of initial slots in the buffer; the number of
slots required by the buffer will be expanded as required.public boolean isEmpty()
public int size()
public void insert(java.lang.Object obj)
obj
- The object to be inserted. It must not be null.public java.lang.Object remove()
public void flush()
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.