lij.runtime
Class LetterBox

java.lang.Object
  extended by lij.runtime.LetterBox

public class LetterBox
extends java.lang.Object

This class provides functionality for sending and receiving messages (encapsulated in Letter instances).

Author:
Nikolaos Chatzinikolaou

Field Summary
private  java.util.ArrayList<Letter> letters
           
private  Monitor monitor
           
 
Constructor Summary
LetterBox(Monitor _monitor)
          Constructor.
 
Method Summary
 Letter getLetter(LetterPostData postData)
          Attempts to retrieve the specified Letter from the letter queue.
 void putLetter(Letter letter)
          Puts the specified Letter into the letter queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

letters

private java.util.ArrayList<Letter> letters

monitor

private Monitor monitor
Constructor Detail

LetterBox

public LetterBox(Monitor _monitor)
Constructor.

Parameters:
_monitor - A pointer to the monitor GUI.
Method Detail

getLetter

public Letter getLetter(LetterPostData postData)
Attempts to retrieve the specified Letter from the letter queue.

Parameters:
postData - The post data of the Letter being looked for.
Returns:
The Letter, if found; null otherwise.

putLetter

public void putLetter(Letter letter)
Puts the specified Letter into the letter queue.

Parameters:
letter - The Letter to put into the queue.