|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NumberSet<N extends java.lang.Number>
Represents a set of unique numbers.
Nested Class Summary | |
---|---|
static class |
NumberSet.Query<N extends java.lang.Number>
Deprecated. use NumberCollection.seq(int, Number, Number) |
Method Summary | |
---|---|
boolean |
add(Extent<N> extent)
Adds the given extent of numbers to the set. |
boolean |
add(N number)
Adds the given number to the set. |
boolean |
add(N start,
N end)
Adds an extent of numbers between start end end to the set. |
boolean |
add(NumberCollection<N> set)
Adds the content of the given set to this set. |
boolean |
addAll(NumberSet<N> set)
Deprecated. Use add(NumberCollection) |
boolean |
change(N start,
N end,
boolean add)
Calls add(Number, Number) if add is true
otherwise remove(Number, Number) is called. |
boolean |
clear()
Removes all of the numbers from this set. |
NumberSet<N> |
copy()
Deprecated. use copyNumberSet() , becuase copy cannot be overriden by subclasses in a type safe manner
similarily as the #clone() method cannot. |
NumberSet<N> |
copyNumberSet()
Returns a copy of this set. |
void |
delete(Extent<N> extent)
Deprecated. use Section.adjust(Number, Number) |
void |
delete(N number)
Deprecated. Use Section.adjust(Number, Number) |
void |
delete(N start,
N end)
Deprecated. Use Section.adjust(Number, Number) |
java.util.Iterator<Extent<N>> |
extentIterator(NumberSet.Query<N> query)
Returns an extent iterator according to the given query. |
NumberSet<N> |
getUnchecked()
Returns a better performing but less user friendly implementation for this number set that is more loop efficient: does not check validity of the method arguments does not mark the layout as required computing on every method call, instead relying on the client to call Matrix.refresh()
|
void |
insert(N target,
N count)
Deprecated. Use Section.adjust(Number, Number) |
java.util.Iterator<N> |
numberIterator(NumberSet.Query<N> query)
Returns an number iterator according to the given query. |
boolean |
remove(Extent<N> extent)
Removes the given extent of numbers from this set. |
boolean |
remove(N number)
Removes the given number from this set. |
boolean |
remove(N start,
N end)
Removes an extent of numbers between start end end from this set. |
boolean |
remove(NumberCollection<N> set)
Removes the content of the given set from this set. |
boolean |
removeAll(NumberSet<N> set)
Deprecated. Use remove(NumberCollection) |
boolean |
toggle(N n)
If the given number is present in this set then it is removed, otherwise it is added to this set. |
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 |
---|
boolean add(N start, N end)
start
- first index of the range of itemsend
- last index of the range of items
true
if this operation has changed the set content.boolean add(N number)
number
- to be added
true
if this operation has changed the set content.boolean add(Extent<N> extent)
extent
- the range of items to add
true
if this operation has changed the set content.boolean add(NumberCollection<N> set)
set
- to be added
true
if this operation has changed the set content.@Deprecated boolean addAll(NumberSet<N> set)
add(NumberCollection)
set
- to be added
true
if this operation has changed the set content.boolean remove(N start, N end)
start
- first index of the range of itemsend
- last index of the range of items
true
if this operation has changed the set content.boolean remove(N number)
number
- to remove.
true
if this operation has changed the set content.boolean remove(Extent<N> extent)
extent
- the range of items to remove
true
if this operation has changed the set content.boolean remove(NumberCollection<N> set)
set
- to remove
true
if this operation has changed the set content.@Deprecated boolean removeAll(NumberSet<N> set)
remove(NumberCollection)
set
- to remove
true
if this operation has changed the content of the setboolean toggle(N n)
n
- number to be added or removed
true
if this operation has changed the content of the setboolean clear()
boolean change(N start, N end, boolean add)
add(Number, Number)
if add
is true
otherwise remove(Number, Number)
is called.
start
- first index of the range of itemsend
- last index of the range of itemsadd
- determines whether the given range is added or removed
true
if this operation has changed the content of the set@Deprecated void insert(N target, N count)
Section.adjust(Number, Number)
Numbers are inserted before the given target number or at the end if the target equals to the (last number in the set) + 1.
target
- the number before which the new numbers are insertedcount
- the number of items to insert
java.lang.IndexOutOfBoundsException
- if target or count is null
java.lang.IndexOutOfBoundsException
- if target is out of 0 ...
NumberCollection.getCount()
bounds
java.lang.IllegalArgumentException
- if start is greater then end@Deprecated void delete(N start, N end)
Section.adjust(Number, Number)
start
- first index of the range of itemsend
- last index of the range of items
java.lang.IndexOutOfBoundsException
- if start or end is null
java.lang.IndexOutOfBoundsException
- if start or end is negative
java.lang.IllegalArgumentException
- if start is greater then end@Deprecated void delete(N number)
Section.adjust(Number, Number)
number
- number to be deleted
java.lang.IndexOutOfBoundsException
- if number is null
java.lang.IndexOutOfBoundsException
- if number is negative
java.lang.IllegalArgumentException
- if start is greater then end@Deprecated void delete(Extent<N> extent)
Section.adjust(Number, Number)
extent
- first index of the range of items to remove
java.lang.IndexOutOfBoundsException
- if extent is null
java.util.Iterator<Extent<N>> extentIterator(NumberSet.Query<N> query)
query
- parameters changing the default iteration which is forward over all items. See NumberSet.Query
.
null
value means the default query.
java.util.Iterator<N> numberIterator(NumberSet.Query<N> query)
query
- parameters changing the default iteration which is forward over all items. See NumberSet.Query
.
null
value means the default query.
@Deprecated NumberSet<N> copy()
copyNumberSet()
, becuase copy cannot be overriden by subclasses in a type safe manner
similarily as the #clone()
method cannot.
NumberSet<N> copyNumberSet()
NumberSet<N> getUnchecked()
Matrix.refresh()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |