Package net.imglib2.type.numeric.integer
Class IntegerTypes
- java.lang.Object
-
- net.imglib2.type.numeric.integer.IntegerTypes
-
public class IntegerTypes extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<? extends IntegerType<?>>signedTypesprivate static java.util.List<? extends IntegerType<?>>unsignedTypes
-
Constructor Summary
Constructors Modifier Constructor Description privateIntegerTypes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntegerType<?>smallestType(boolean signed, long max)Get anIntegerTypethat can hold the givenmaxvalue.static IntegerType<?>smallestType(long min, long max)
-
-
-
Field Detail
-
signedTypes
private static java.util.List<? extends IntegerType<?>> signedTypes
-
unsignedTypes
private static java.util.List<? extends IntegerType<?>> unsignedTypes
-
-
Method Detail
-
smallestType
public static IntegerType<?> smallestType(boolean signed, long max)
Get anIntegerTypethat can hold the givenmaxvalue. The smallest byte-size type matching the constraints will be selected.- Parameters:
signed- -trueif a signedIntegerTypeis requiredmax- - the expected maximum value- Returns:
- an
IntegerTypematching the given constraints
-
smallestType
public static IntegerType<?> smallestType(long min, long max)
Get anIntegerTypethat can hold the givenminandmaxvalues. The smallest byte-size type matching the constraints will be selected, with a preference for unsigned types.- Parameters:
min- - the expected minimum valuemax- - the expected maximum value- Returns:
- an
IntegerTypematching the given constraints
-
-