com.faunos.util.dim.line
Enum OutCode
java.lang.Object
java.lang.Enum<OutCode>
com.faunos.util.dim.line.OutCode
- All Implemented Interfaces:
- Serializable, Comparable<OutCode>
public enum OutCode
- extends Enum<OutCode>
Represents the location of a 1d point (a scalar value), relative to
a 1d object (e.g. a Range
).
The idea here is borrowed from Rectangle2D.outcode
.
- Author:
- Babak Farhang
- See Also:
Ranges.outCode(long, Range)
Method Summary |
boolean |
above()
|
boolean |
below()
|
int |
encodeIndex(int index)
|
boolean |
inside()
|
static OutCode |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static OutCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they're declared. |
BELOW
public static final OutCode BELOW
INSIDE
public static final OutCode INSIDE
ABOVE
public static final OutCode ABOVE
values
public static final OutCode[] values()
- Returns an array containing the constants of this enum type, in
the order they're declared. This method may be used to iterate
over the constants as follows:
for(OutCode c : OutCode.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they're declared
valueOf
public static OutCode 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 name
below
public boolean below()
inside
public boolean inside()
above
public boolean above()
encodeIndex
public int encodeIndex(int index)