|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.tum.cs.commons.region.Region
public final class Region
Regions represent intervals. Both the start and the end position are considered to be part of the region. Regions can i.e. be used to represent fragments of files.
This class is immutable.
| Field Summary | |
|---|---|
static String |
UNKNOWN_ORIGIN
Name that is used if region is created without name |
| Constructor Summary | |
|---|---|
Region(int start,
int end)
Creates a region with an unknown origin |
|
Region(int start,
int end,
String origin)
Creates a region with an origin |
|
| Method Summary | |
|---|---|
boolean |
adjacent(Region r)
Checks if two regions are adjacent |
int |
compareTo(Region compareTo)
Compares regions by their start position |
boolean |
containsPosition(int position)
Checks if the region contains a position |
int |
getEnd()
Gets the end position of the region |
int |
getLength()
Gets the length of the region |
String |
getOrigin()
Get origin. |
int |
getStart()
Gets the start position of the region |
boolean |
overlaps(Region r)
Checks if two regions are overlapping |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String UNKNOWN_ORIGIN
| Constructor Detail |
|---|
public Region(int start,
int end,
String origin)
start - Start position of the regionend - End position of the regionorigin - Region origin. (i.e. region producer)
public Region(int start,
int end)
start - Start position of the regionend - End position of the region| Method Detail |
|---|
public boolean containsPosition(int position)
public boolean overlaps(Region r)
public boolean adjacent(Region r)
public String getOrigin()
public int getEnd()
public int getStart()
public int getLength()
public String toString()
toString in class Objectpublic int compareTo(Region compareTo)
compareTo in interface Comparable<Region>
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||