Package org.cyclos.entities.utils
Class IntegerRange
- java.lang.Object
-
- org.cyclos.entities.utils.IntegerRange
-
- All Implemented Interfaces:
Cloneable,IIntegerRange,Range<Integer>
@Embeddable public class IntegerRange extends Object implements Cloneable, IIntegerRange
Contains a range of integer numbers
-
-
Constructor Summary
Constructors Constructor Description IntegerRange()IntegerRange(Integer min, Integer max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntegerRangebetween(int min, int max)Returns a range from min to maxIntegerRangeclone()booleanequals(Object obj)static IntegerRangefixed(int length)Returns a range from and to the parameterstatic IntegerRangefrom(int min)Returns a range from min with no maxIntegergetMax()IntegergetMin()inthashCode()booleaninRange(int number)Check if the given number is in rangebooleanisEmpty()booleanisOpen()Return true if any border is nullvoidsetMax(Integer max)voidsetMin(Integer min)static IntegerRangeto(int max)Returns a range from to max with no minStringtoString()
-
-
-
Method Detail
-
between
public static IntegerRange between(int min, int max)
Returns a range from min to max
-
fixed
public static IntegerRange fixed(int length)
Returns a range from and to the parameter
-
from
public static IntegerRange from(int min)
Returns a range from min with no max
-
to
public static IntegerRange to(int max)
Returns a range from to max with no min
-
clone
public IntegerRange clone()
-
inRange
public boolean inRange(int number)
Check if the given number is in range
-
isEmpty
public boolean isEmpty()
-
isOpen
public boolean isOpen()
Return true if any border is null
-
setMax
public void setMax(Integer max)
-
setMin
public void setMin(Integer min)
-
-