ewe.util
Class RangeList
java.lang.Object
ewe.data.DataObject
ewe.util.Vector
ewe.util.RangeList
- All Implemented Interfaces:
- Comparable, Copyable, DataUnit
- public class RangeList
- extends Vector
A RangeList manages a set of Range object - but you should never add
Range objects to it directly. The RangeList always ensures that its
collection of Ranges are fully optimized. That is if two ranges
are contiguous, they are merged to form a single range. Similarly
overlapping ranges are also merged. The ranges
are also always sorted in increasing order.
| Methods inherited from class ewe.util.Vector |
add, add, add, addAll, addAll, addAll, addCopiesFrom, addElement, clear, compare, contains, copyCopiesFrom, copyFrom, copyInto, copyInto, del, elementAt, elements, find, find, get, getCount, getFullCopy, insert, insertElementAt, isEmpty, iterator, iterator, pop, push, remove, removeAllElements, removeElementAt, set, setElementAt, setSize, size, sort, sort, toArray, toArray, toObjectArray, toString, zero |
| Methods inherited from class ewe.data.DataObject |
_getSetField, appendAllFields, compareTo, copied, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew |
buff
protected static Range buff
RangeList
public RangeList()
inRange
public boolean inRange(int start)
inRange
public boolean inRange(int start,
int end)
findRangeWith
public int findRangeWith(int value)
addRange
public void addRange(int start,
int end)
removeRange
public void removeRange(int start,
int end)
fixup
protected void fixup()
countItems
public int countItems()
toIntArray
public int[] toIntArray()
getItemAtIndex
public int getItemAtIndex(int idx)
shift
public void shift(int fromWhere,
int places)
- Use this to shift up or down, but be careful shifting down.
countRanges
public int countRanges()
rangeAt
public Range rangeAt(int rangeIndex,
Range dest)
removeAndShiftUp
public void removeAndShiftUp(int start,
int end)