java.lang.Object
io.github.shimeoki.jfx.rasterization.Ints
Class for some operations on integers that are not in the standard
Math class.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
confined
(int low, int x, int high) Returns an integer that is the confined value ofx
for two bounds.static int
max3
(int v1, int v2, int v3) Gets a maximum integer out of three values.static int
min3
(int v1, int v2, int v3) Gets a minumum integer out of three values.
-
Method Details
-
confined
public static int confined(int low, int x, int high) Returns an integer that is the confined value ofx
for two bounds.If
x
is less thanlow
, thenlow
is returned.If
x
is more thanhigh
, thenhigh
is returned.Otherwise
x
is returned.- Parameters:
low
- lower boundx
- target integer to confinehigh
- upper bound- Returns:
- confined integer
- Since:
- 2.0.0
-
min3
public static int min3(int v1, int v2, int v3) Gets a minumum integer out of three values.- Parameters:
v1
- first integerv2
- second integerv3
- third integer- Returns:
- minimum integer out of three values
- Since:
- 2.0.0
-
max3
public static int max3(int v1, int v2, int v3) Gets a maximum integer out of three values.- Parameters:
v1
- first integerv2
- second integerv3
- third integer- Returns:
- maximum integer out of three values
- Since:
- 2.0.0
-