primitive
Class Buffer

java.lang.Object
  extended byjava.lang.Thread
      extended byprimitive.Buffer
All Implemented Interfaces:
java.lang.Runnable

public class Buffer
extends java.lang.Thread

Buffer.java This class creates a Object buffer which causes the get method to block until an Object is availabe.

Author:
Avi TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Buffer()
          Constructor for Buffer class.
 
Method Summary
 java.lang.Object get()
          Get an Object from the Buffer.
 java.lang.String getIP()
          A Buffer can be bound to an IP address in order to aid Debugging
 void insert(java.lang.Object O)
          Inserts an Object into the buffer.
 void setIP(java.lang.String IP)
          A Buffer can be bound to an IP address in order to aid Debugging
 int size()
          The current size of the buffer.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Buffer

public Buffer()
Constructor for Buffer class. Creates an empty ArrayList to hold the Objects

Method Detail

getIP

public java.lang.String getIP()
A Buffer can be bound to an IP address in order to aid Debugging

Returns:
The IP address which this Buffer is bound to.

setIP

public void setIP(java.lang.String IP)
A Buffer can be bound to an IP address in order to aid Debugging

Parameters:
IP - The IP address which this Buffer is to be bound.

size

public int size()
The current size of the buffer.

Returns:
int representing the current size of the buffer

insert

public void insert(java.lang.Object O)
Inserts an Object into the buffer.

Parameters:
O - The Object to be inserted.

get

public java.lang.Object get()
Get an Object from the Buffer. Method blocks until an Object is available.

Returns:
First Object in the Buffer