public class Range extends Object implements Comparable<Range>
Constructor and Description |
---|
Range(double min,
double max)
Creates a new range based on the specified borders as <a, b).
|
Range(int min,
int max)
Creates a new range based on the specified borders as <a, b).
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Range o) |
boolean |
contains(double value)
Finds out whether the value lies in the range.
|
boolean |
equals(Object o) |
double |
getMax()
Gets the right border of the range.
|
double |
getMin()
Gets the left border of the range.
|
int |
hashCode() |
String |
toString() |
public Range(double min, double max)
min
- Left border of the range.max
- Right border of the range.public Range(int min, int max)
min
- Left border of the range.max
- Right border of the range.public double getMin()
public double getMax()
public boolean contains(double value)
value
- The value to be checked.public int compareTo(Range o)
compareTo
in interface Comparable<Range>
Copyright © 2010–2017 PerfCake Community. All rights reserved.