tesuji.games.go
Class Util

java.lang.Object
  |
  +--tesuji.games.go.Util

public class Util
extends java.lang.Object

Here are some routines that are generally usefull and convenient to have.

Creation date: (17-May-01 2:36:43 PM)

Product: Tesuji Software Go Library.

Copyright (c) 2001 Tesuji Software B.V.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of a Tesuji Software shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of Tesuji Software.


Constructor Summary
Util()
           
 
Method Summary
static IntStack getIntStack()
          Allocate an IntStack of default size.
static int getNlib(int startXY, int max, byte color, byte[] board)
          Same as the other getNlib method except it doesn't store the liberties.
static int getNlib(int startXY, int max, byte color, byte[] board, IntStack libertyStack)
          Get the number of liberties of a chain.
static Point getPoint()
           
static Point getPoint(int x, int y)
           
static UniqueList getUniqueList()
          Allocate an UniqueList.
static boolean isEmptyTriangle(int xy, byte color, byte[] board)
          

Creation date: (09-May-01 6:25:55 PM)

static java.lang.String printCoordinate(int xy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

printCoordinate

public static java.lang.String printCoordinate(int xy)

getIntStack

public static IntStack getIntStack()
Allocate an IntStack of default size. Instead of allocating new objects each time, the objects created through this method can be 'recycled' and then reused. This is much more efficient than relying on the VM to allocate an object and then later garbage-collect it again.

Creation date: (17-May-01 2:37:36 PM)


getNlib

public static final int getNlib(int startXY,
                                int max,
                                byte color,
                                byte[] board)
Same as the other getNlib method except it doesn't store the liberties.

Creation date: (19-May-01 6:52:56 PM)


getNlib

public static final int getNlib(int startXY,
                                int max,
                                byte color,
                                byte[] board,
                                IntStack libertyStack)
Get the number of liberties of a chain. The stones are in the 'board' array that is passed in. The liberties are put on the stack parameter. Only a maximum number of liberties are retrieved, depending on the 'max' parameter. If the starting point is empty, then the liberties are counted as if a stone of 'color' was played there.

Creation date: (19-May-01 6:52:56 PM)


getPoint

public static Point getPoint()

getPoint

public static Point getPoint(int x,
                             int y)

getUniqueList

public static UniqueList getUniqueList()
Allocate an UniqueList. Instead of allocating new objects each time, the objects created through this method can be 'recycled' and then reused. This is much more efficient than relying on the VM to allocate an object and then later garbage-collect it again.

Creation date: (17-May-01 2:37:36 PM)


isEmptyTriangle

public static boolean isEmptyTriangle(int xy,
                                      byte color,
                                      byte[] board)


Creation date: (09-May-01 6:25:55 PM)