public enum RelativeCoordinate extends java.lang.Enum<RelativeCoordinate> implements IDatatypePost<java.lang.Double,java.lang.Double>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
apply(IDatatypeContext ctx,
java.lang.Double origin)
Takes the expected input and transforms it based on the value held by
original . |
java.util.stream.Stream<java.lang.String> |
tabComplete(IDatatypeContext ctx)
Attempts to complete missing or partial input provided through the
IArgConsumer } provided by
IDatatypeContext.getConsumer() in order to aide the user in executing commands. |
static RelativeCoordinate |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static RelativeCoordinate[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RelativeCoordinate INSTANCE
public static RelativeCoordinate[] values()
for (RelativeCoordinate c : RelativeCoordinate.values()) System.out.println(c);
public static RelativeCoordinate valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.Double apply(IDatatypeContext ctx, java.lang.Double origin) throws CommandException
IDatatypePost
original
. If original
is null, it is expected that the implementation of this method has a case to handle it, such that a
NullPointerException
will never be thrown as a result.apply
in interface IDatatypePost<java.lang.Double,java.lang.Double>
ctx
- The datatype contextorigin
- The transformable valueCommandException
public java.util.stream.Stream<java.lang.String> tabComplete(IDatatypeContext ctx) throws CommandException
IDatatype
IArgConsumer
} provided by
IDatatypeContext.getConsumer()
in order to aide the user in executing commands.
One benefit over datatypes over IArgParser
s is that instead of each command trying to guess what values
the datatype will accept, or simply not tab completing at all, datatypes that support tab completion can provide
accurate information using the same methods used to parse arguments in the first place.
tabComplete
in interface IDatatype
ctx
- The argument consumer to tab completeCommandException
IArgConsumer.tabCompleteDatatype(IDatatype)