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

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

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

Represents an range of numbers between start and end values inclusive.

Instances of this class are immutable.


Method Summary
static
<N extends java.lang.Number>
Extent<N>
create(N start, N end)
          Creates extent of numbers between start and end values inclusively.
static
<N extends java.lang.Number>
Extent<N>
createUnchecked(N start, N end)
          Creates extent of numbers between start and end values inclusively without arguments checking.
 boolean equals(java.lang.Object obj)
           
 N getEnd()
          Returns the last index of the range of items.
 N getStart()
          Returns first index of the range of items.
 int hashCode()
           
static
<N extends java.lang.Number>
java.util.Iterator<N>
numberIterator(pl.netanel.swt.matrix.Math<N> math, java.util.List<pl.netanel.swt.matrix.MutableExtent<N>> items)
          Deprecated. 
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static <N extends java.lang.Number> Extent<N> create(N start,
                                                            N end)
Creates extent of numbers between start and end values inclusively. Arguments are validated.

start and end numbers are item indexes in the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
start - first index of the range of items
end - last index of the range of items
Returns:
new instance of this class
Throws:
java.lang.IllegalArgumentException - if start or end is null
java.lang.IllegalArgumentException - if start is greater then end
java.lang.IndexOutOfBoundsException - if start or end is negative

createUnchecked

public static <N extends java.lang.Number> Extent<N> createUnchecked(N start,
                                                                     N end)
Creates extent of numbers between start and end values inclusively without arguments checking.

start and end numbers are item indexes in the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
start - first index of the range of items
end - last index of the range of items
Returns:
new instance of this class

getStart

public N getStart()
Returns first index of the range of items.

Returns:
first index of the range of items

getEnd

public N getEnd()
Returns the last index of the range of items.

Returns:
the last index of the range of items

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

numberIterator

@Deprecated
public static <N extends java.lang.Number> java.util.Iterator<N> numberIterator(pl.netanel.swt.matrix.Math<N> math,
                                                                                           java.util.List<pl.netanel.swt.matrix.MutableExtent<N>> items)
Deprecated. 



Copyright © 2011 netanel.pl. All Rights Reserved.