Package pl.poznan.put.torsion.range
Enum RangeDifference
- java.lang.Object
-
- java.lang.Enum<RangeDifference>
-
- pl.poznan.put.torsion.range.RangeDifference
-
- All Implemented Interfaces:
Serializable,Comparable<RangeDifference>
public enum RangeDifference extends Enum<RangeDifference>
A distance betweenTorsionRangeobjects.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RangeDifferencefromValue(int value)Parses value 0, 1, 2, or 3 as EQUAL, SIMILAR, DIFFERENT and OPPOSITE respectively.intgetValue()static RangeDifferencevalueOf(String name)Returns the enum constant of this type with the specified name.static RangeDifference[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EQUAL
public static final RangeDifference EQUAL
-
SIMILAR
public static final RangeDifference SIMILAR
-
DIFFERENT
public static final RangeDifference DIFFERENT
-
OPPOSITE
public static final RangeDifference OPPOSITE
-
INVALID
public static final RangeDifference INVALID
-
-
Method Detail
-
values
public static RangeDifference[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RangeDifference c : RangeDifference.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RangeDifference valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
fromValue
public static RangeDifference fromValue(int value)
Parses value 0, 1, 2, or 3 as EQUAL, SIMILAR, DIFFERENT and OPPOSITE respectively. Value different to 0, 1, 2 or 3 results in INVALID.- Parameters:
value- A value of 0, 1, 2 or 3 (all other are treated as invalid).- Returns:
- An instance of this enum.
-
getValue
public int getValue()
- Returns:
- 0 for EQUAL, 1 for SIMILAR, 2 for DIFFERENT, 3 for OPPOSITE and -1 for INVALID.
-
-