pl.netanel.swt.matrix
Class Cell<X extends java.lang.Number,Y extends java.lang.Number>

java.lang.Object
  extended by pl.netanel.swt.matrix.Cell<X,Y>
Type Parameters:
X - indexing type for horizontal axis
Y - indexing type for vertical axis

public class Cell<X extends java.lang.Number,Y extends java.lang.Number>
extends java.lang.Object

Pair of indexes representing cell coordinates. Instances of this class are immutable.


Method Summary
static
<X extends java.lang.Number,Y extends java.lang.Number>
Cell<X,Y>
create(X indexX, Y indexY)
          Creates a new instance of cell.
static
<X extends java.lang.Number,Y extends java.lang.Number>
Cell<X,Y>
createUnchecked(X indexX, Y indexY)
          Creates a new instance of cell without checking arguments validity.
 boolean equals(java.lang.Object obj)
           
 X getIndexX()
          Returns cell index on the horizontal axis.
 Y getIndexY()
          Returns cell index on the vertical axis.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static <X extends java.lang.Number,Y extends java.lang.Number> Cell<X,Y> create(X indexX,
                                                                                       Y indexY)
Creates a new instance of cell. Arguments are validated.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
a new instance of this class
Throws:
java.lang.IllegalArgumentException - if indexX or indexY is null
java.lang.IndexOutOfBoundsException - if indexX or IndexY is negative

createUnchecked

public static <X extends java.lang.Number,Y extends java.lang.Number> Cell<X,Y> createUnchecked(X indexX,
                                                                                                Y indexY)
Creates a new instance of cell without checking arguments validity.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
a new instance of this class

getIndexX

public X getIndexX()
Returns cell index on the horizontal axis.

Returns:
cell index on the horizontal axis

getIndexY

public Y getIndexY()
Returns cell index on the vertical axis.

Returns:
cell index on the vertical axis

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 netanel.pl. All Rights Reserved.