Package net.sf.basedb.core
Class BlockInfo
- java.lang.Object
-
- net.sf.basedb.core.BlockInfo
-
public final class BlockInfo extends Object
ABlockInfo
object is used to represent the uniqe identifiers of anArrayDesignBlock
. It can either be the block number or the metagrid coordinates. If block number is used metagrid can be added but they are not used to identify an arraydesignblock and it is possible to create two blocks with the same metagrid as long as the blocknumbers are uniqe.- Version:
- 2.0
- Author:
- Enell, Nicklas
- Last modified
- $Date: 2009-04-06 14:52:39 +0200 (må, 06 apr 2009) $
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Check if this object is equal to anotherBlockInfo
object.int
getBlock()
Get the block number.int
getMetaGridX()
Get the row or x meta coordinate.int
getMetaGridY()
Get the column or y meta coordinate.int
hashCode()
Calculate the hash code for the object.String
toString()
Get the coordinate as [number;metaGridX,metaGridY]
-
-
-
Constructor Detail
-
BlockInfo
public BlockInfo(int metaGridX, int metaGridY) throws InvalidDataException
Create a new block info using the meta coordinates. Block is set to 0.- Parameters:
metaGridX
- The row or x meta coordinatemetaGridY
- The column or y meta coordinate- Throws:
InvalidDataException
- If any of the coordinates is 0 or negative
-
BlockInfo
public BlockInfo(int block, int metaGridX, int metaGridY) throws InvalidDataException
Create a new block info using meta coordinates.- Parameters:
block
- The block number which must be greater or equal than 0metaGridX
- The row or x meta coordinate, use 0 if unknownmetaGridY
- The column or y meta coordinate, use 0 if unknown- Throws:
InvalidDataException
- If the block number is 0 or negative
-
-
Method Detail
-
equals
public final boolean equals(Object o)
Check if this object is equal to anotherBlockInfo
object. They are equal if they have the same block number > 0, or the same meta coordinates.
-
hashCode
public final int hashCode()
Calculate the hash code for the object.
-
toString
public final String toString()
Get the coordinate as [number;metaGridX,metaGridY]
-
getMetaGridX
public int getMetaGridX()
Get the row or x meta coordinate.
-
getMetaGridY
public int getMetaGridY()
Get the column or y meta coordinate.
-
getBlock
public int getBlock()
Get the block number. If the block number is 0 it is considerd unknown and meta coordinates are used instead.
-
-