data
Class Board

java.lang.Object
  extended by data.Board

public class Board
extends java.lang.Object


Field Summary
(package private)  java.util.concurrent.ConcurrentHashMap<java.lang.String,BoardObject> objectHm
           
(package private)  long timeout
          Expire time in ms after that a BoardObject will be obsolete
 
Constructor Summary
Board()
           
 
Method Summary
 BoardObject addObject(java.lang.String key, BoardObject newObject)
           
 void clear()
          Empties the internal data structure.
 BoardObject[] getArrayList()
           
 java.util.Iterator<java.util.Map.Entry<java.lang.String,BoardObject>> getIterator()
           
 BoardObject getObject(java.lang.String key)
           
 java.util.Set<java.util.Map.Entry<java.lang.String,BoardObject>> getSet()
           
 long getTimeout()
           
 java.util.ArrayList<java.lang.String> getTopicList(java.lang.String topic)
           
(package private)  void removeIfObsolete()
          Not public methods must be called here!
(package private)  void removeIfObsolete(java.lang.String key)
          Not public methods must be called here!
 BoardObject removeObject(java.lang.String key)
           
 void setTimeout(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectHm

java.util.concurrent.ConcurrentHashMap<java.lang.String,BoardObject> objectHm

timeout

long timeout
Expire time in ms after that a BoardObject will be obsolete

Constructor Detail

Board

public Board()
Method Detail

addObject

public BoardObject addObject(java.lang.String key,
                             BoardObject newObject)
Parameters:
key -
newObject -
Returns:
Previous BoardObject or null if it was not found

getObject

public BoardObject getObject(java.lang.String key)
Parameters:
key -
Returns:
The BoardObject for the key or null if not found on the board.

removeObject

public BoardObject removeObject(java.lang.String key)
Parameters:
key - BoardObject identifier.
Returns:
Previous BoardObject or null if it was not found.

clear

public void clear()
Empties the internal data structure.


getIterator

public java.util.Iterator<java.util.Map.Entry<java.lang.String,BoardObject>> getIterator()

getSet

public java.util.Set<java.util.Map.Entry<java.lang.String,BoardObject>> getSet()

getTimeout

public long getTimeout()
Returns:
The timeout of a BoardObject in ms before it will be considered obsolete.

setTimeout

public void setTimeout(long timeout)
Parameters:
timeout - The timeout in ms of a BoardObject before it will be considered obsolete.

removeIfObsolete

void removeIfObsolete(java.lang.String key)
Not public methods must be called here! Due to recursion.


removeIfObsolete

void removeIfObsolete()
Not public methods must be called here! Due to recursion.


getTopicList

public java.util.ArrayList<java.lang.String> getTopicList(java.lang.String topic)
Parameters:
topic - String identifying the topic.
Returns:
An ArrayList of all board keys belonging to the given topic. Usually the topic is the Object class name.

getArrayList

public BoardObject[] getArrayList()