org.space4j
Interface Space

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
SimpleSpace

public interface Space
extends java.io.Serializable

The Space where the objects will be stored in memory. The Space is typically a data structure like a Map used to store the Objects used by your application. During a snapshot, the whole Space object is serialized to disk.

Author:
Sergio Oliveira Jr

Method Summary
 boolean check(java.lang.Object key)
          Checks whehter an object exists with the following key.
<T> T
get(java.lang.Object key)
          Gets the Object stored in this Space with this key.
 IndexManager getIndexManager()
          Returns the IndexManager in this space.
<T> java.util.Iterator<T>
getIterator(java.lang.Object key)
          Returns an iterator of the underlying collection or map object.
<T> java.util.Iterator<T>
getKeyIterator(java.lang.Object key)
          Returns an iterator of the keys of the underlying map object.
 void put(java.lang.Object key, java.lang.Object obj)
          Puts an Object in this Space with this key.
 boolean remove(java.lang.Object key)
          Removes an Object from this Space with this key.
 

Method Detail

get

<T> T get(java.lang.Object key)
Gets the Object stored in this Space with this key.

Parameters:
key - The key to retrieve the Object from the Space.
Returns:
The object stored in the Space with this key or null with there is no such object.

put

void put(java.lang.Object key,
         java.lang.Object obj)
Puts an Object in this Space with this key. If and Object already exists with this key, the object is replaced by the new one.

Parameters:
key - The key to store the Object
obj - The object to store

remove

boolean remove(java.lang.Object key)
Removes an Object from this Space with this key.

Parameters:
key -
Returns:
true if object existed and was removed

getIterator

<T> java.util.Iterator<T> getIterator(java.lang.Object key)
Returns an iterator of the underlying collection or map object.

Parameters:
key - The key to retrieve the Object from the Space.
Returns:
A safe iterator of the data structure.

check

boolean check(java.lang.Object key)
Checks whehter an object exists with the following key.

Parameters:
key - The key to check
Returns:
true if there is an object

getKeyIterator

<T> java.util.Iterator<T> getKeyIterator(java.lang.Object key)
Returns an iterator of the keys of the underlying map object.

Parameters:
key - The key to retrieve the Object from the Space.
Returns:
A safe iterator of the keys of the Map.

getIndexManager

IndexManager getIndexManager()
Returns the IndexManager in this space.

Returns:
The IndexManager in this space.


Copyright © 2005 Space4J Team. All Rights Reserved.