public class NonOverlappingIntervalList extends java.util.TreeSet<SimpleSequenceInterval>
SequenceIntervalList
,
Serialized FormConstructor and Description |
---|
NonOverlappingIntervalList() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int pos) |
boolean |
add(int firstPos,
int lastPos) |
boolean |
add(SimpleSequenceInterval e) |
void |
addAll(NonOverlappingIntervalList other)
Adds all of the intervals contained in another list to this list.
|
void |
addAll(NonOverlappingIntervalList other,
int firstIndex,
int lastIndex,
boolean moveToFront)
Adds all or a part of the intervals contained in another list to this list.
|
boolean |
contains(int pos)
Checks whether the specified position is marked by this list.
|
boolean |
containsAll(int firstPos,
int lastPos)
Checks whether all positions in the specified interval are marked by this list.
|
java.util.SortedSet<SimpleSequenceInterval> |
getOverlappingElements(int firstPos,
int lastPos) |
void |
movePositions(int start,
int offset) |
boolean |
remove(int firstPos,
int lastPos)
Removes the specified interval from this list.
|
boolean |
remove(java.lang.Object o)
Removes the specified object from this interval list.
|
addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, size, spliterator, subSet, subSet, tailSet, tailSet
containsAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public NonOverlappingIntervalList()
public boolean add(SimpleSequenceInterval e)
add
in interface java.util.Collection<SimpleSequenceInterval>
add
in interface java.util.Set<SimpleSequenceInterval>
add
in class java.util.TreeSet<SimpleSequenceInterval>
public boolean add(int pos)
public boolean add(int firstPos, int lastPos)
public boolean remove(java.lang.Object o)
o
in an instance of
SimpleSequenceInterval
but this exact interval is not contained in this list,
this method will delegate to remove(int, int)
, which may then modify
overlapping interval entries.remove
in interface java.util.Collection<SimpleSequenceInterval>
remove
in interface java.util.Set<SimpleSequenceInterval>
remove
in class java.util.TreeSet<SimpleSequenceInterval>
true
if an object was removed or intervals have been modified.TreeSet.remove(java.lang.Object)
public boolean remove(int firstPos, int lastPos)
firstPos
- the first index of the interval to be removed (must be >= 0
)lastPos
- the index after the last position to be removed (must be > firstIndex
).true
if any changes were made to the listpublic void addAll(NonOverlappingIntervalList other, int firstIndex, int lastIndex, boolean moveToFront)
other
- the other list instancefirstIndex
- the first position from where to start the import (must be >= 0
)lastIndex
- the index after the last position to be imported (must be > firstIndex
).moveToFront
- Specify true
here, if you want to move the imported intervals to the
front of the target list. (An interval starting at firstIndex
would than start at 0
in the target list.)public void addAll(NonOverlappingIntervalList other)
addAll(other, 0, other.last().getLastPos() + 1, false)
.other
- the other list instancepublic void movePositions(int start, int offset)
public boolean contains(int pos)
pos
- the position to be checkedtrue
if the specified position is marked by this list, false
otherwise.public boolean containsAll(int firstPos, int lastPos)
firstPos
- the first position of the interval to be checkedlastPos
- the last position of the interval to be checked (inclusive)true
if all specified positions are marked by this list, false
otherwise.public java.util.SortedSet<SimpleSequenceInterval> getOverlappingElements(int firstPos, int lastPos)