Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cgsuite
Class Context.DefaultContext  view Context.DefaultContext download Context.DefaultContext.java

java.lang.Object
  extended bycgsuite.Context
      extended bycgsuite.Context.DefaultContext
Enclosing class:
Context

public static class Context.DefaultContext
extends Context


Nested Class Summary
 
Nested classes inherited from class cgsuite.Context
Context.DefaultContext
 
Field Summary
(package private)  java.util.Comparator gameComparator
           
(package private)  java.util.Map primaryCache
           
 
Fields inherited from class cgsuite.Context
activeContext
 
Constructor Summary
Context.DefaultContext()
           
 
Method Summary
 void checkKernelState()
           
 java.lang.String createOutputString(java.lang.Object obj)
          Creates a string representation of the specified object.
 void generateLogMessage(int level, java.lang.String source, java.lang.String message)
           
 void generateOutput(java.lang.Object obj)
          Generates output for the specified object.
 void generateWarning(java.lang.String warning)
          Generates a warning message.
 java.util.Comparator getGameComparator()
          Gets a Comparator that can be used to compare any two objects of type Game.
 java.util.Map getPrimaryCache()
          Gets a reference to the primary cache.
 
Methods inherited from class cgsuite.Context
getActiveContext, setActiveContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primaryCache

java.util.Map primaryCache

gameComparator

java.util.Comparator gameComparator
Constructor Detail

Context.DefaultContext

public Context.DefaultContext()
Method Detail

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