|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jarol.Port
public class Port
Port is a data transfer point that provides concurrent access for a single-reader and
a single-writer. There is no support for multiple readers or writers. All items that are put and taken from the buffer
are cloned, also all items must implement the MessageInterface
to provide cloning.
Constructor Summary | |
---|---|
Port()
Constructs a port with the standard buffer size. |
|
Port(int size)
Creates a port with a specified buffer size. |
Method Summary | |
---|---|
int |
getBufferSize()
Returns the buffer size. |
MessageInterface |
read()
Reads the oldest element from the buffer without blocking. |
boolean |
write(MessageInterface item)
Writes an item into the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Port()
public Port(int size)
size
- indicates the size of the bufferMethod Detail |
---|
public MessageInterface read()
public boolean write(MessageInterface item)
item
- - The element to be added into the buffer.
public int getBufferSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |