cgsuite
Class Context.DefaultContext

java.lang.Object
cgsuite.Context
cgsuite.Context.DefaultContext
- Enclosing class:
- Context
- public static class Context.DefaultContext
- extends Context
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
primaryCache
java.util.Map primaryCache
gameComparator
java.util.Comparator gameComparator
Context.DefaultContext
public Context.DefaultContext()
getPrimaryCache
public java.util.Map getPrimaryCache()
- Description copied from class:
Context
- Gets a reference to the primary cache. The primary cache
is a hashtable that is shared between the CGSuite core library and
all plug-ins. Plug-ins should prefer to use the primary cache rather
than a private cache; this gives the kernel greater control over
memory management.
- Specified by:
getPrimaryCache in class Context
getGameComparator
public java.util.Comparator getGameComparator()
- Description copied from class:
Context
- Gets a
Comparator that can be used to compare any two
objects of type Game.
This is useful primarily for games that have many other objects of
type Game as sub-games. The comparator can be used to
conduct more efficient searches and to provide consistent output.
- Specified by:
getGameComparator in class Context
createOutputString
public java.lang.String createOutputString(java.lang.Object obj)
- Description copied from class:
Context
- Creates a string representation of the specified object. An output
handler for the object must be registered with the kernel (see the
cgsuite.plugin package for details.)
Note that a game's toString method is often
insufficient for this purpose. For example, the String
that corresponds to a CanonicalGame depends on user-specific
options.
- Specified by:
createOutputString in class Context
generateOutput
public void generateOutput(java.lang.Object obj)
- Description copied from class:
Context
- Generates output for the specified object. The output is added to
the kernel's output queue to be displayed at the next opportunity.
This method should be used by plug-ins that need to display output
in mid-calculation.
- Specified by:
generateOutput in class Context
generateWarning
public void generateWarning(java.lang.String warning)
- Description copied from class:
Context
- Generates a warning message.
This method should be used by plug-ins to report a warning - that is,
an error that is not severe enough to justify aborting the calculation.
- Specified by:
generateWarning in class Context
generateLogMessage
public void generateLogMessage(int level,
java.lang.String source,
java.lang.String message)
- Specified by:
generateLogMessage in class Context
checkKernelState
public void checkKernelState()
- Specified by:
checkKernelState in class Context