Package net.sf.basedb.core
Class BlockInfo
java.lang.Object
net.sf.basedb.core.BlockInfo
A
BlockInfo
object is used to represent the uniqe identifiers of an
ArrayDesignBlock
. 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) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Check if this object is equal to anotherBlockInfo
object.int
getBlock()
Get the block number.int
Get the row or x meta coordinate.int
Get the column or y meta coordinate.final int
hashCode()
Calculate the hash code for the object.final String
toString()
Get the coordinate as [number;metaGridX,metaGridY]
-
Field Details
-
block
private final int blockThe block number. -
metaGridY
private final int metaGridYThe Y coordinate of the block. -
metaGridX
private final int metaGridXThe X coordinate of the block.
-
-
Constructor Details
-
BlockInfo
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
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 Details
-
equals
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
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.
-