pl.netanel.swt.matrix
Class AxisItem<N extends java.lang.Number>

java.lang.Object
  extended by pl.netanel.swt.matrix.AxisItem<N>
Type Parameters:
N - specifies the indexing class for the axis

public class AxisItem<N extends java.lang.Number>
extends java.lang.Object

Represents an axis item characterized by a section and an index within that section. Instances of this class are immutable.


Method Summary
static
<N2 extends java.lang.Number>
AxisItem<N2>
create(Section<N2> section, N2 index)
          Creates a new instance of axis item.
static
<N2 extends java.lang.Number>
AxisItem<N2>
createUnchecked(Section<N2> section, N2 index)
          Creates a new instance of cell without checking arguments validity.
 boolean equals(java.lang.Object obj)
           
 N getIndex()
          Return index of this axis item.
 Section<N> getSection()
          Returns section of this axis item.
 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 <N2 extends java.lang.Number> AxisItem<N2> create(Section<N2> section,
                                                                N2 index)
Creates a new instance of axis item. Arguments are validated.

Parameters:
section - section of an axis
index - item index in the section
Returns:
a new instance of this class
Throws:
java.lang.IllegalArgumentException - if section or index is null
java.lang.IndexOutOfBoundsException - if index is out of 0 ... Section.getCount() bounds

createUnchecked

public static <N2 extends java.lang.Number> AxisItem<N2> createUnchecked(Section<N2> section,
                                                                         N2 index)
Creates a new instance of cell without checking arguments validity.

Parameters:
section - section of an axis
index - item index in the section
Returns:

getSection

public Section<N> getSection()
Returns section of this axis item.

Returns:
section of this axis item

getIndex

public N getIndex()
Return index of this axis item.

Returns:
index of this axis item

toString

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

equals

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

hashCode

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


Copyright © 2011 netanel.pl. All Rights Reserved.