Class NumberUtils
java.lang.Object
org.checkerframework.common.value.util.NumberUtils
Utility routines for manipulating numbers.
- 
Method SummaryModifier and TypeMethodDescriptioncastNumbers(TypeMirror type, boolean isUnsigned, List<? extends Number> numbers) Converts aList<A>to aList<B>, where A and B are numeric types.castNumbers(TypeMirror type, List<? extends Number> numbers) Converts aList<A>to aList<B>, where A and B are numeric types.static RangecastRange(TypeMirror type, Range range) Return a range that restricts the given range to the given type.
- 
Method Details- 
castNumbersConverts aList<A>to aList<B>, where A and B are numeric types.- Parameters:
- type- the type to cast to
- numbers- the numbers to cast to the given type
- Returns:
- a list of numbers of the given type
 
- 
castNumberspublic static @Nullable List<? extends Number> castNumbers(TypeMirror type, boolean isUnsigned, List<? extends Number> numbers) Converts aList<A>to aList<B>, where A and B are numeric types.- Parameters:
- type- the type to cast to
- isUnsigned- if true, treat- typeas unsigned
- numbers- the numbers to cast to the given type
- Returns:
- a list of numbers of the given type
 
- 
castRangeReturn a range that restricts the given range to the given type. That is, return the range resulting from casting a value with the given range.- Parameters:
- type- the type for the cast; the result will be within it
- range- the original range; the result will be within it
- Returns:
- the intersection of the given range and the possible values of the given type
 
 
-