pl.netanel.swt.matrix
Interface NumberContinuum<N extends java.lang.Number>

All Superinterfaces:
java.lang.Iterable<N>, NumberCollection<N>

public interface NumberContinuum<N extends java.lang.Number>
extends NumberCollection<N>

Represents a continuum of integer numbers, from 0 to given count. Only the count and order of numbers in continuum can be modified.


Method Summary
 NumberContinuum<N> copyNumberContinuum()
           
 N get(N position)
          Returns the number at given position in the list.
 N indexOf(N n)
          Returns the position of the given number in the list.
 void move(N start, N end, N target)
          Moves the given range of numbers before the given target.
 boolean move(NumberCollection<N> subject, Matrix.DropPosition dropPosition, N target)
           
 
Methods inherited from interface pl.netanel.swt.matrix.NumberCollection
contains, contains, contains, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, copyNumberCollection, getCount, getCount, isEmpty, seq, seq
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

get

N get(N position)
Returns the number at given position in the list. Performance of default implementation: O(count)

Parameters:
position - position of the item in the list
Returns:
the number at given position in the list
Throws:
java.lang.IndexOutOfBoundsException - when position > getCount

indexOf

N indexOf(N n)
Returns the position of the given number in the list.

Parameters:
n - number to get the position of
Returns:
the position of the given number in the list

move

void move(N start,
          N end,
          N target)
Moves the given range of numbers before the given target. For example having 5 items in the section move(2, 3, 1) will result in the following order: 0, 2, 3, 1, 4.

start, end and target 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
target - the index of the target item
Throws:
java.lang.IllegalArgumentException - if start or end is null
java.lang.IndexOutOfBoundsException - if start or end is out of 0 ... NumberCollection.getCount()-1 bounds
java.lang.IndexOutOfBoundsException - if target is out of 0 ... NumberCollection.getCount() bounds
java.lang.IllegalArgumentException - if start is greater then end

move

boolean move(NumberCollection<N> subject,
             Matrix.DropPosition dropPosition,
             N target)

copyNumberContinuum

NumberContinuum<N> copyNumberContinuum()


Copyright © 2011 netanel.pl. All Rights Reserved.