public enum NumericalResultFunction extends Enum<NumericalResultFunction>
NumericalEntry
class to determine the outcome of integer parameter
negotiations.
The behavior of this enumeration is described in the getResult(int, int)
method.
Enum Constant and Description |
---|
MAX
The
getResult(int, int) method will return the larger one of the two parameters. |
MIN
The
getResult(int, int) method will return the smaller one of the two parameters. |
Modifier and Type | Method and Description |
---|---|
int |
getResult(int a,
int b)
Returns either the value of the first or the second parameter, depending of the value of this enumeration.
|
static NumericalResultFunction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NumericalResultFunction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NumericalResultFunction MIN
getResult(int, int)
method will return the smaller one of the two parameters.public static final NumericalResultFunction MAX
getResult(int, int)
method will return the larger one of the two parameters.public static NumericalResultFunction[] values()
for (NumericalResultFunction c : NumericalResultFunction.values()) System.out.println(c);
public static NumericalResultFunction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic int getResult(int a, int b)
a
- the first valueb
- the second valueCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.