org.jicengine.operation
Interface Context

All Known Implementing Classes:
AbstractContext, EmptyContext

public interface Context

Context : a namespace for objects.

Author:
.timo

Nested Class Summary
static class Context.DuplicateNameException
           
static class Context.ObjectNotFoundException
           
 
Method Summary
 void addObject(java.lang.String name, java.lang.Object object)
          If addObject success, the object stored will be returned by getObject with the same name.
 java.lang.Object getObject(java.lang.String name)
          finds an object from the context.
 boolean hasObject(java.lang.String name)
           
 

Method Detail

getObject

public java.lang.Object getObject(java.lang.String name)
                           throws Context.ObjectNotFoundException
finds an object from the context.

Returns:
the object. NOTE: currently no null values supported.
Throws:
Context.ObjectNotFoundException - if the context doesn't have an object with the given name.

hasObject

public boolean hasObject(java.lang.String name)

addObject

public void addObject(java.lang.String name,
                      java.lang.Object object)
               throws Context.DuplicateNameException
If addObject success, the object stored will be returned by getObject with the same name.

Throws:
Context.DuplicateNameException - if there already is another object with the same name in the context.