public class Range extends Object
Constructor and Description |
---|
Range()
Constructs a
Range . |
Range(int start,
int end)
Constructs a
Range with the specified start and end values. |
Range(int start,
int end,
List<Range> excludes)
Constructs a
Range with the specified start and end values and
Range s of excluded values. |
Range(int start,
int end,
Range exclude)
Constructs a
Range with the specified start and end values and a
Range of excluded values. |
Range(Range range)
Constructs a
Range that is a deep copy of the specified range. |
Modifier and Type | Method and Description |
---|---|
void |
addExclude(Range exclude)
Adds a
Range to be excluded from this Range . |
boolean |
contains(int value)
Returns
true if value is included in this Range . |
boolean |
equals(Object obj) |
int |
getEnd()
Returns the end of the
Range . |
List<Range> |
getExcludes()
Returns the exclusions for this range.
|
int[] |
getRangeValues()
Returns an array of the values contained in this
Range . |
int |
getStart()
Returns the start of the
Range . |
int |
hashCode() |
void |
removeExclude(Range exclude)
Removes a
Range from the exclusions for this range. |
void |
setEnd(int end)
Sets the end of the range.
|
void |
setExcludes(List<Range> excludes)
Sets the exclusions for this range.
|
void |
setStart(int start)
Sets the start of the
Range . |
String |
toString() |
public Range()
Range
.public Range(int start, int end)
Range
with the specified start and end values.start
- the start of the rangeend
- the end of the rangepublic Range(int start, int end, Range exclude)
Range
with the specified start and end values and a
Range
of excluded values.start
- the start of the rangeend
- the end of the rangeexclude
- the range to excludepublic Range(int start, int end, List<Range> excludes)
Range
with the specified start and end values and
Range
s of excluded values.start
- the start of the rangeend
- the end of the rangeexcludes
- the ranges to excludepublic Range(Range range)
Range
that is a deep copy of the specified range.range
- the Range
to copypublic boolean contains(int value)
true
if value
is included in this Range
.value
- public int[] getRangeValues()
Range
.Range
public int getStart()
Range
.Range
public void setStart(int start)
Range
.start
- the new value for start of the Range
public int getEnd()
Range
.Range
public void setEnd(int end)
end
- the new value for end of the Range
public void addExclude(Range exclude)
Range
to be excluded from this Range
.exclude
- a Range
to be excludedpublic void removeExclude(Range exclude)
Range
from the exclusions for this range.exclude
- a Range
to be removed from the exclusionspublic List<Range> getExcludes()
public void setExcludes(List<Range> excludes)
excludes
- the exclusions for this rangeCopyright © 2015–2016 The Apache Software Foundation. All rights reserved.