Package org.spongepowered.api.util
Interface Range<T extends Number>
- Type Parameters:
- T- The type of bound
public interface Range<T extends Number>
Represents a range. The type is unbounded such that optional minima and
 maxima can be used.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceGenerates specific implementations of theRangeinterface.
- 
Method SummaryModifier and TypeMethodDescriptiondoubleRange(@Nullable Double min, @Nullable Double max) Builds aRangebased on doubles.floatRange(@Nullable Float min, @Nullable Float max) Builds aRangebased on floats.Builds aRangebased on integers.@Nullable Tmax()Gets the maximum, if it exists.@Nullable Tmin()Gets the minimum, if it exists.
- 
Method Details- 
floatRangeBuilds aRangebased on floats.- Parameters:
- min- The minimum, or- nullfor no minimum
- max- The maximum, or- nullfor no maximum
- Returns:
- The range.
 
- 
intRangeBuilds aRangebased on integers.- Parameters:
- min- The minimum, or- nullfor no minimum
- max- The maximum, or- nullfor no maximum
- Returns:
- The range.
- Throws:
- IllegalArgumentException- if min is smaller than max
 
- 
doubleRangeBuilds aRangebased on doubles.- Parameters:
- min- The minimum, or- nullfor no minimum
- max- The maximum, or- nullfor no maximum
- Returns:
- The range.
 
- 
min@Nullable T min()Gets the minimum, if it exists.- Returns:
- The minimum.
 
- 
max@Nullable T max()Gets the maximum, if it exists.- Returns:
- The maximum
 
 
-