Enum Command
- java.lang.Object
-
- java.lang.Enum<Command>
-
- org.openstreetmap.josm.data.imagery.vectortile.mapbox.Command
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ClosePath
This is only explicitly valid forGeometryTypes.POLYGON
.LineTo
While not explicitly prohibited forGeometryTypes.POINT
, it should be ignored.MoveTo
ForGeometryTypes.POINT
, eachMoveTo
is a new point.
-
Field Summary
Fields Modifier and Type Field Description private static Command[]
CACHED_VALUES
private byte
id
private byte
parameters
-
Constructor Summary
Constructors Modifier Constructor Description private
Command(byte id, byte parameters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static Command[]
getAllValues()
Get a pre-calculated array of allCommand
values.byte
getId()
Get the command idbyte
getParameterNumber()
Get the number of parametersstatic Command
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Command[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MoveTo
public static final Command MoveTo
ForGeometryTypes.POINT
, eachMoveTo
is a new point. ForGeometryTypes.LINESTRING
andGeometryTypes.POLYGON
, eachMoveTo
is a new geometry of the same type.
-
LineTo
public static final Command LineTo
While not explicitly prohibited forGeometryTypes.POINT
, it should be ignored. ForGeometryTypes.LINESTRING
andGeometryTypes.POLYGON
, eachLineTo
extends that geometry.
-
ClosePath
public static final Command ClosePath
This is only explicitly valid forGeometryTypes.POLYGON
. It closes theGeometryTypes.POLYGON
.
-
-
Field Detail
-
CACHED_VALUES
private static final Command[] CACHED_VALUES
-
id
private final byte id
-
parameters
private final byte parameters
-
-
Constructor Detail
-
Command
private Command(byte id, byte parameters)
-
-
Method Detail
-
values
public static Command[] 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 (Command c : Command.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Command valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getId
public byte getId()
Get the command id- Returns:
- The id
-
getParameterNumber
public byte getParameterNumber()
Get the number of parameters- Returns:
- The number of parameters
-
getAllValues
static Command[] getAllValues()
Get a pre-calculated array of allCommand
values.- Returns:
- An array of values, meant as a drop-in replacement for
values()
where the array is not modified! This can significantly reduce allocations, as there is no defensive array copy.
-
-