© 2006-2007 ETH Zurich

org.ximtec.igesture.algorithm.signature
Class Grid

java.lang.Object
  extended by org.ximtec.igesture.algorithm.signature.Grid

public class Grid
extends Object

Implementation of the grid that is used to create the signature.

Version:
1.0 Dec 11, 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Constructor Summary
Grid(int size)
          Constructs a new grid.
 
Method Summary
static Grid createInstance(int size)
          Returns the grid with the desired size.
 int getBitStringLength()
           
 BitSet getSignature(int x, int y)
          Returns the signature of a given field of the grid.
 void setCell(int x, int y, BitSet bitSet)
          Sets the signature of a field.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Grid

public Grid(int size)
Constructs a new grid.

Parameters:
size - the size of the grid (size*size).
Method Detail

getBitStringLength

public int getBitStringLength()

getSignature

public BitSet getSignature(int x,
                           int y)
Returns the signature of a given field of the grid.

Parameters:
x - the x coordinate.
y - the y coordinate.
Returns:
the signature.

setCell

public void setCell(int x,
                    int y,
                    BitSet bitSet)
Sets the signature of a field.

Parameters:
x - the x coordinate.
y - the y coordinate.
bitSet - the signature of the field.

createInstance

public static Grid createInstance(int size)
Returns the grid with the desired size. If the grid is available in the cache, the cached instance is returned. Otherwise a new grid instance is created and added to the cache.

Parameters:
size - the size of the grid to be returned.
Returns:
grid with the specified size.

toString

public String toString()
Overrides:
toString in class Object

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.