public class MsgRange extends java.lang.Object implements java.lang.Comparable<MsgRange>, java.io.Serializable
Constructor and Description |
---|
MsgRange() |
MsgRange(int id) |
MsgRange(int low,
int hi) |
MsgRange(MsgRange that) |
Modifier and Type | Method and Description |
---|---|
static MsgRange[] |
collapse(MsgRange[] ranges)
Collapse multiple possibly overlapping ranges into as few ranges non-overlapping
ranges as possible: [1..6],[2..4],[5..7] -> [1..7].
|
int |
compareTo(MsgRange other) |
static MsgRange |
enclosing(MsgRange[] ranges)
Get maximum enclosing range.
|
int |
getLower() |
int |
getUpper() |
static MsgRange[] |
listToRanges(java.util.List<java.lang.Integer> list)
Convert List of IDs to multiple ranges.
|
protected void |
normalize() |
java.lang.String |
toString() |
protected boolean |
tryExtending(int h) |
public MsgRange()
public MsgRange(int id)
public MsgRange(int low, int hi)
public MsgRange(MsgRange that)
public int compareTo(MsgRange other)
compareTo
in interface java.lang.Comparable<MsgRange>
public java.lang.String toString()
toString
in class java.lang.Object
public int getLower()
public int getUpper()
protected boolean tryExtending(int h)
protected void normalize()
public static MsgRange[] listToRanges(java.util.List<java.lang.Integer> list)
public static MsgRange[] collapse(MsgRange[] ranges)
ranges
- ranges to collapse