public class Range extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
end
Ending position of this range.
|
String |
id
Optional id for this range.
|
int |
start
Starting position of this range.
|
| Constructor and Description |
|---|
Range(int start,
int end)
Creates a new range with given starting and ending values.
|
Range(int start,
int end,
String id)
Creates a new range with given starting and ending values and an id.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int pos)
Returns true if the range contains a given position within its bounds.
|
boolean |
contains(Range range)
Returns true if the range contains a given range within its bounds.
|
boolean |
intersectsWith(Range range)
Returns true if the range intersects with a given range.
|
String |
toString()
Gets the string representation of the range with its id (its start and end position, and the id
between parenthesis).
|
public int start
public int end
public String id
public Range(int start,
int end)
start - the start value of the new range.end - the end value of the new range.public Range(int start,
int end,
String id)
start - the start value of the new range.end - the end value of the new range.id - the identifier value of the new range.public boolean contains(int pos)
pos - the given position.public boolean contains(Range range)
range - the given range.public boolean intersectsWith(Range range)
range - the given range.Copyright © 2022. All rights reserved.