public class Range extends Object
This class is Thread-Safe.
Modifier and Type | Field and Description |
---|---|
static Range |
INT_POSITIVE
Positive integer numbers including 0.
|
static Range |
INT_POSITIVE_STRICT
Positive integer numbers excluding 0.
|
Constructor and Description |
---|
Range()
Create a blank range where min and max are equals to
0 . |
Range(int min,
int max)
Create a range.
|
Modifier and Type | Method and Description |
---|---|
int |
getMax()
Get maximum value.
|
int |
getMin()
Get minimum value.
|
boolean |
includes(double value)
Check if value is inside range, min and max included.
|
boolean |
includes(int value)
Check if value is inside range, min and max included.
|
public static final Range INT_POSITIVE
public static final Range INT_POSITIVE_STRICT
public Range()
0
.public Range(int min, int max)
min
- The minimum value (must be inferior or equal to max).max
- The maximum value (must be superior or equal to min).LionEngineException
- If illegal arguments.public int getMin()
public int getMax()
public boolean includes(int value)
value
- The value to check.true
if value is inside range, false
else.public boolean includes(double value)
value
- The value to check.true
if value is inside range, false
else.Copyright © 2016 Byron 3D Games Studio. All rights reserved.