public class SimpleRegion extends java.lang.Object implements java.lang.Comparable<SimpleRegion>, java.io.Serializable
Region
. Both start and end positions are
inclusive.Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
END_PROPERTY
The name of the JSON property name for
end . |
static java.util.Comparator<SimpleRegion> |
START_AND_END_COMPARATOR
Compares
SimpleRegion s first by their start and then by their end. |
protected static java.lang.String |
START_PROPERTY
The name of the JSON property name for
start . |
Constructor and Description |
---|
SimpleRegion(int start,
int end)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
adjacent(SimpleRegion r)
Checks if two regions are adjacent
|
int |
compareTo(SimpleRegion other)
Compares regions by their start position
|
boolean |
containsPosition(int position)
Checks if the region contains a position
|
boolean |
equals(java.lang.Object other) |
boolean |
equalsStartEnd(SimpleRegion other)
Returns whether start and end of the region is the same as for this region.
|
int |
getEnd()
Gets the end position of the region.
|
int |
getLength()
Gets the length of the region.
|
int |
getStart()
Gets the start position of the region
|
int |
hashCode() |
boolean |
isEmpty()
Returns whether this region is empty.
|
boolean |
overlaps(SimpleRegion r)
Checks if two regions are overlapping
|
java.lang.String |
toString() |
protected static final java.lang.String START_PROPERTY
start
.protected static final java.lang.String END_PROPERTY
end
.public static final java.util.Comparator<SimpleRegion> START_AND_END_COMPARATOR
SimpleRegion
s first by their start and then by their end.public SimpleRegion(int start, int end)
public boolean containsPosition(int position)
public boolean overlaps(SimpleRegion r)
public boolean adjacent(SimpleRegion r)
public int getEnd()
isEmpty()
).public int getStart()
public int getLength()
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(SimpleRegion other)
compareTo
in interface java.lang.Comparable<SimpleRegion>
public boolean equalsStartEnd(SimpleRegion other)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object