tesuji.games.go
Class ByteArrayImpl

java.lang.Object
  |
  +--tesuji.games.go.ByteArrayImpl
All Implemented Interfaces:
ByteArray
Direct Known Subclasses:
Influence

public class ByteArrayImpl
extends java.lang.Object
implements ByteArray

1-dimensional implementation of ByteArray.

Creation date: (19-May-01 2:13:23 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.


Field Summary
protected  byte[] array
           
 
Constructor Summary
ByteArrayImpl(int size)
          ByteArrayImpl constructor comment.
ByteArrayImpl(int size, byte[] array)
          ByteArrayImpl constructor comment.
 
Method Summary
 byte get(int xy)
          Get an element from the array using a 1-dimensional coordinate.
 byte get(int x, int y)
          Get an element from the array using a 2-dimensional coordinate.
 int getBoardSize()
          Get the board-size for this array.
 byte[][] getDoubleArray()
          Get the array as a 2-dimensional array.
 byte[] getSingleArray()
          Get the array as a 1-dimensional array.
 int getWidth()
          Get the width that is used to do the coordinate conversion between 1-dimensional and 2-dimensional.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

array

protected byte[] array
Constructor Detail

ByteArrayImpl

public ByteArrayImpl(int size)
ByteArrayImpl constructor comment.

ByteArrayImpl

public ByteArrayImpl(int size,
                     byte[] array)
ByteArrayImpl constructor comment.
Method Detail

get

public byte get(int xy)
Get an element from the array using a 1-dimensional coordinate.
Specified by:
get in interface ByteArray

get

public byte get(int x,
                int y)
Get an element from the array using a 2-dimensional coordinate.
Specified by:
get in interface ByteArray

getBoardSize

public int getBoardSize()
Get the board-size for this array.
Specified by:
getBoardSize in interface ByteArray

getDoubleArray

public byte[][] getDoubleArray()
Get the array as a 2-dimensional array.
Specified by:
getDoubleArray in interface ByteArray

getSingleArray

public byte[] getSingleArray()
Get the array as a 1-dimensional array.
Specified by:
getSingleArray in interface ByteArray

getWidth

public int getWidth()
Get the width that is used to do the coordinate conversion between 1-dimensional and 2-dimensional.
Specified by:
getWidth in interface ByteArray