Catalano.Core
Class IntRange
- java.lang.Object
-
- Catalano.Core.IntRange
-
- All Implemented Interfaces:
- java.io.Serializable
public class IntRange extends java.lang.Object implements java.io.SerializableRepresents an integer range with minimum and maximum values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description IntRange()Initializes a new instance of the IntRange class.IntRange(int min, int max)Initializes a new instance of the IntRange class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)intgetMax()Get Maximum value of the range.intgetMin()Get minimum value of the range.inthashCode()booleanisInside(int x)Check if the specified range is inside of the range.booleanIsOverlapping(IntRange range)Check if the specified range overlaps with the range.doublelength()Length of the range (difference between maximum and minimum values).voidsetMax(int max)Set maximum value of the range.voidsetMin(int min)Set minimum value of the range.DoubleRangetoDoubleRange()Convert IntRange to DoubleRange.FloatRangetoFloatRange()Convert IntRange to FloatRange.java.lang.StringtoString()
-
-
-
Constructor Detail
-
IntRange
public IntRange()
Initializes a new instance of the IntRange class.
-
IntRange
public IntRange(int min, int max)Initializes a new instance of the IntRange class.- Parameters:
min- Minimum value of the range.max- Maximum value of the range.
-
-
Method Detail
-
getMin
public int getMin()
Get minimum value of the range.- Returns:
- Minimum value.
-
setMin
public void setMin(int min)
Set minimum value of the range.- Parameters:
min- Minimum value.
-
getMax
public int getMax()
Get Maximum value of the range.- Returns:
- Maximum value.
-
setMax
public void setMax(int max)
Set maximum value of the range.- Parameters:
max- Maximum value.
-
length
public double length()
Length of the range (difference between maximum and minimum values).- Returns:
- Length.
-
isInside
public boolean isInside(int x)
Check if the specified range is inside of the range.- Parameters:
x- Value.- Returns:
- True if the value is inside of the range, otherwise returns false.
-
IsOverlapping
public boolean IsOverlapping(IntRange range)
Check if the specified range overlaps with the range.- Parameters:
range- IntRange.- Returns:
- True if the range overlaps with the range, otherwise returns false.
-
toFloatRange
public FloatRange toFloatRange()
Convert IntRange to FloatRange.- Returns:
- FloatRange.
-
toDoubleRange
public DoubleRange toDoubleRange()
Convert IntRange to DoubleRange.- Returns:
- DoubleRange.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG