Package org.eclipse.imagen.media.range
Class RangeFactory
Object
RangeFactory
This class is a factory class which creates a
Range object for the specific data type. This Range can have 2
bounds or be a single-point range. If the 2 bound values are equal and almost one of them is included, then a
single-point range is created, else an exception is thrown. If the minimum bound value is bigger than the maximum
value, then the 2 numbers are inverted at the Range creation time.-
Method Summary
Modifier and TypeMethodDescriptionstatic RangeConvert to Range of the specifiedDataBuffertype.static Rangeconvert(Range input, Range.DataType dataType) Convert to Range of the specified data type, casting or creating a copy if needed.static RangeByteconvertToByteRange(Range input) static RangeDoubleconvertToDoubleRange(Range input) Convert to RangeDouble casting or creating a copy if needed.static RangeFloatconvertToFloatRange(Range input) Convert to RangeFloat casting or creating a copy if needed.static RangeBytecreate(byte minValue, boolean minIncluded, byte maxValue, boolean maxIncluded) static RangeBytecreate(byte minValue, byte maxValue) static RangeDoublecreate(double minValue, boolean minIncluded, double maxValue, boolean maxIncluded) static RangeDoublecreate(double minValue, boolean minIncluded, double maxValue, boolean maxIncluded, boolean nanIncluded) static RangeDoublecreate(double minValue, double maxValue) static RangeFloatcreate(float minValue, boolean minIncluded, float maxValue, boolean maxIncluded) static RangeFloatcreate(float minValue, boolean minIncluded, float maxValue, boolean maxIncluded, boolean nanIncluded) static RangeFloatcreate(float minValue, float maxValue) static RangeIntcreate(int minValue, boolean minIncluded, int maxValue, boolean maxIncluded) static RangeIntcreate(int minValue, int maxValue) static RangeLongcreate(long minValue, boolean minIncluded, long maxValue, boolean maxIncluded) static RangeShortcreate(short minValue, boolean minIncluded, short maxValue, boolean maxIncluded) static RangeShortcreate(short minValue, short maxValue) static RangeUshortcreateU(short minValue, boolean minIncluded, short maxValue, boolean maxIncluded) static RangeUshortcreateU(short minValue, short maxValue) static booleanequals(double d1, double d2) static Range
-
Method Details
-
create
public static RangeByte create(byte minValue, boolean minIncluded, byte maxValue, boolean maxIncluded) -
createU
public static RangeUshort createU(short minValue, boolean minIncluded, short maxValue, boolean maxIncluded) -
create
public static RangeShort create(short minValue, boolean minIncluded, short maxValue, boolean maxIncluded) -
create
-
create
public static RangeFloat create(float minValue, boolean minIncluded, float maxValue, boolean maxIncluded, boolean nanIncluded) -
create
public static RangeDouble create(double minValue, boolean minIncluded, double maxValue, boolean maxIncluded, boolean nanIncluded) -
create
-
createU
-
create
-
create
-
create
-
create
-
create
public static RangeFloat create(float minValue, boolean minIncluded, float maxValue, boolean maxIncluded) -
create
public static RangeDouble create(double minValue, boolean minIncluded, double maxValue, boolean maxIncluded) -
create
public static RangeLong create(long minValue, boolean minIncluded, long maxValue, boolean maxIncluded) -
convertToDoubleRange
Convert to RangeDouble casting or creating a copy if needed.- Parameters:
input- Range- Returns:
- RangeDouble
-
convertToFloatRange
Convert to RangeFloat casting or creating a copy if needed.- Parameters:
input- Range- Returns:
- RangeFloat
-
convert
Convert to Range of the specified data type, casting or creating a copy if needed.- Parameters:
input- Range to convertdataType- DataType for conversion- Returns:
- Converted Range instance
-
convert
Convert to Range of the specifiedDataBuffertype. Conversion is done as a cast if possible, otherwise a new Range is created.- Parameters:
input- Range to convertdataType- DataBuffer dataType- Returns:
- Converted Range instance
-
convertToByteRange
-
subtract
-
intersect
-
equals
public static boolean equals(double d1, double d2)
-