org.moyoman.debug
Class Discrete

java.lang.Object
  |
  +--org.moyoman.debug.Debug
        |
        +--org.moyoman.debug.Discrete

public class Discrete
extends Debug

This class is used to store evaluations of different points. Points are rated as positive, negative, or neutral. A point may be occupied by a black or white stone, or it may be an unoccupied point. This is similar to the Continuous debug type, but is meant to be used when only the values 1.0, 0.0, and -1.0 would ever occur. For example, the Ladder module might use this to show all points that would break the opponents ladder as positive, and all points that break your own ladder as negative.


Field Summary
private  ArrayList negative
           
private  ArrayList neutral
           
private  ArrayList positive
           
 
Fields inherited from class org.moyoman.debug.Debug
 
Constructor Summary
Discrete(String h)
          Create a new Discrete object.
 
Method Summary
 void addNegativePoint(Point p)
          Add a point to the list of negative points.
 void addNegativePoints(Point[] p)
          Add an array of points to the list of negative points.
 void addNeutralPoint(Point p)
          Add a point to the list of neutral points.
 void addNeutralPoints(Point[] p)
          Add an array of points to the list of neutral points.
 void addPositivePoint(Point p)
          Add a point to the list of positive points.
 void addPositivePoints(Point[] p)
          Add an array of points to the list of positive points.
 Point[] getNegativePoints()
          Return the negative points.
 Point[] getNeutralPoints()
          Return the neutral points.
 Point[] getPositivePoints()
          Return the positive points.
 DebugType getType()
          Get the type of this object.
 String toString()
          Return a String representation of this object.
 
Methods inherited from class org.moyoman.debug.Debug
getHeaderType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

positive

private ArrayList positive

negative

private ArrayList negative

neutral

private ArrayList neutral
Constructor Detail

Discrete

public Discrete(String h)
Create a new Discrete object.

Parameters:
h - The header.
Method Detail

addNegativePoint

public void addNegativePoint(Point p)
                      throws InconsistentStateException
Add a point to the list of negative points.

Parameters:
p - The point to be added to the list.
Throws:
InconsistentStateException - Thrown if the point is already in one of the lists.

addNegativePoints

public void addNegativePoints(Point[] p)
                       throws InconsistentStateException
Add an array of points to the list of negative points.

Parameters:
p - The array of points to be added to the list.
Throws:
InconsistentStateException - Thrown if the point is already in one of the lists.

addNeutralPoint

public void addNeutralPoint(Point p)
                     throws InconsistentStateException
Add a point to the list of neutral points.

Parameters:
p - The point to be added to the list.
Throws:
InconsistentStateException - Thrown if the point is already in one of the lists.

addNeutralPoints

public void addNeutralPoints(Point[] p)
                      throws InconsistentStateException
Add an array of points to the list of neutral points.

Parameters:
p - The array of points to be added to the list.
Throws:
InconsistentStateException - Thrown if the point is already in one of the lists.

addPositivePoint

public void addPositivePoint(Point p)
                      throws InconsistentStateException
Add a point to the list of positive points.

Parameters:
p - The point to be added to the list.
Throws:
InconsistentStateException - Thrown if the point is already in one of the lists.

addPositivePoints

public void addPositivePoints(Point[] p)
                       throws InconsistentStateException
Add an array of points to the list of positive points.

Parameters:
p - The array of points to be added to the list.
Throws:
InconsistentStateException - Thrown if the point is already in one of the lists.

getNegativePoints

public Point[] getNegativePoints()
Return the negative points.

Returns:
An array of negative points.

getNeutralPoints

public Point[] getNeutralPoints()
Return the neutral points.

Returns:
An array of neutral points.

getPositivePoints

public Point[] getPositivePoints()
Return the positive points.

Returns:
An array of positive points.

toString

public String toString()
Return a String representation of this object.

Overrides:
toString in class Object
Returns:
A String which represents this object.

getType

public DebugType getType()
Get the type of this object.

Specified by:
getType in class Debug
Returns:
DebugType.DISCRETE