public class SymbolCode extends AVListImpl
To parse a symbol code string, construct a new SymbolCode passing in the identifier string as the sole argument. SymbolCode validates and parses the string, and populates its fields according to the contents of the string. If any field in the code is unrecognized SymbolCode throws an exception and indicates the problematic fields in the exception's message. After parsing, each field can be accessed by calling the appropriate accessor methods (for example: getScheme/setScheme). SymbolCodes supports the following fields:
Which fields are populated after parsing a symbol code depends on the MIL-STD-2525 symbology set the symbol code belongs to:
Symbology Set | Coding Scheme | Standard Identity | Battle Dimension | Category | Status | Function ID | Symbol Modifier | Echelon | Country Code | Order of Battle |
---|---|---|---|---|---|---|---|---|---|---|
Warfighting | YES | YES | YES | NO | YES | YES | YES | NO | YES | YES |
Tactical Graphics | YES | YES | NO | YES | YES | YES | NO | YES | YES | YES |
Signals Intelligence | YES | YES | YES | NO | YES | YES | NO | NO | YES | YES |
Stability Operations | YES | YES | NO | YES | YES | YES | YES | NO | YES | YES |
Emergency Management | YES | YES | NO | YES | YES | YES | YES | NO | YES | YES |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
UNUSED_POSITION_CODE
Indicates the character for an unused position in a MIL-STD-2525 symbol identification code
|
Constructor and Description |
---|
SymbolCode()
Creates a new symbol code, but otherwise does nothing.
|
SymbolCode(java.lang.String symCode)
Creates a new SymbolCode by parsing the fields of the specified MIL-STD-2525 15-character alphanumeric symbol
identification code (SIDC).
|
Modifier and Type | Method and Description |
---|---|
static void |
appendFieldValue(java.lang.StringBuilder sb,
java.lang.String value,
int length)
Appends the specified field value to the specified StringBuilder, padding or trimming the value to fit its length
in the symbol code as necessary.
|
protected java.lang.String |
composeEmergencyManagementSymCode()
Composes a 15-character symbol identification code (SIDC) for the Emergency Management coding scheme.
|
protected java.lang.String |
composeIntelligenceSymCode()
Composes a 15-character symbol identification code (SIDC) for the Signals Intelligence coding scheme.
|
protected java.lang.String |
composeMetocSymCode()
Composes a 15-character symbol identification code (SIDC) for the Meteorological and Oceanographic coding scheme.
|
protected java.lang.String |
composeStabilityOperationsSymCode()
Composes a 15-character symbol identification code (SIDC) for the Stability Operations coding scheme.
|
static java.lang.String |
composeSymbolModifierCode(SymbolCode symbolCode,
AVList modifiers,
java.lang.String modifierKey) |
protected java.lang.String |
composeSymCode()
Composes and returns a MIL-STD-2525 15-character symbol identification code (SIDC) from this SymbolCode's current
field values.
|
protected java.lang.String |
composeTacticalGraphicsSymCode()
Composes a 15-character symbol identification code (SIDC) for the Tactical Graphics coding scheme.
|
protected java.lang.String |
composeUnrecognizedSymCode()
Returns
null indicating that this SymbolCode's Coding Scheme is not recognized. |
protected java.lang.String |
composeWarfightingSymCode()
Composes a 15-character symbol identification code (SIDC) for the Warfighting coding scheme.
|
java.lang.String |
getBattleDimension()
Indicates this symbol code's Battle Dimension field.
|
java.lang.String |
getCategory()
Indicates this symbol code's Category field.
|
java.lang.String |
getCountryCode()
Indicates this symbol code's Country Code field.
|
java.lang.String |
getEchelon()
Indicates this symbol code's Echelon field.
|
java.lang.String |
getFunctionId()
Indicates this symbol code's Function ID field.
|
java.lang.String |
getGraphicType()
Indicates this symbol code's Graphic Type field.
|
java.lang.String |
getOrderOfBattle()
Indicates this symbol code's Order of Battle field.
|
java.lang.String |
getScheme()
Indicates this symbol code's Coding Scheme field.
|
java.lang.String |
getStandardIdentity()
Indicates this symbol code's Standard Identity field.
|
java.lang.String |
getStaticDynamic()
Indicates this symbol code's Static/Dynamic field.
|
java.lang.String |
getStatus()
Indicates this symbol code's Status/Operational Condition field.
|
java.lang.String |
getSymbolModifier()
Indicates this symbol code's Symbol Modifier field.
|
static boolean |
isFieldEmpty(java.lang.String value)
Indicates whether the specified field value is empty.
|
protected boolean |
isUnitsAndEquipmentSymbolModifier(java.lang.String value)
Indicates whether the specified 2-character Symbol Modifier code represents a units and equipment symbol modifier
code.
|
protected java.lang.String |
parseEmergencyManagementSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Emergency Management coding scheme.
|
protected java.lang.String |
parseIntelligenceSymCode(java.lang.String symCode)
Parses symbol codes encoded for the Signals Intelligence coding scheme.
|
protected java.lang.String |
parseMetocSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Meteorological and Oceanographic coding scheme.
|
protected java.lang.String |
parseStabilityOperationsSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Stability Operations coding scheme.
|
static AVList |
parseSymbolModifierCode(java.lang.String code,
AVList params)
Computes and returns the modifier key-value pairs associated with the specified SymbolModifier code.
|
protected java.lang.String |
parseSymCode(java.lang.String symCode)
Parses a symbol code encoded into its individual fields, populating this SymbolCode's fields with the value of
each field.
|
protected java.lang.String |
parseTacticalGraphicsSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Tactical Graphics coding scheme.
|
protected java.lang.String |
parseUnrecognizedSymCode(java.lang.String symCode)
Returns a error string indicating that the symbol code's scheme is not recognized.
|
protected java.lang.String |
parseWarfightingSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Warfighting coding scheme.
|
void |
setBattleDimension(java.lang.String value)
Specifies this symbol code's Battle Dimension field.
|
void |
setCategory(java.lang.String value)
Specifies this symbol code's Category field.
|
void |
setCountryCode(java.lang.String value)
Specifies this symbol code's Country Code field.
|
void |
setEchelon(java.lang.String value)
Specifies this symbol code's Echelon field.
|
void |
setFunctionId(java.lang.String value)
Specifies this symbol code's Function ID field.
|
void |
setGraphicType(java.lang.String value)
Specifies this symbol code's Graphic Type field.
|
void |
setOrderOfBattle(java.lang.String value)
Specifies this symbol code's Order of Battle field.
|
void |
setScheme(java.lang.String value)
Specifies this symbol code's Coding Scheme field.
|
void |
setStandardIdentity(java.lang.String value)
Specifies this symbol code's Standard Identity field.
|
void |
setStaticDynamic(java.lang.String value)
Specifies this symbol code's Static/Dynamic field.
|
void |
setStatus(java.lang.String value)
Specifies this symbol code's Status/Operational Condition field.
|
void |
setSymbolModifier(java.lang.String value)
Specifies this symbol code's Symbol Modifier field.
|
java.lang.String |
toMaskedString()
Indicates a string representation of the symbol code with positions that do not uniquely identify a particular
symbol or graphic replaced with hyphens.
|
java.lang.String |
toString()
Returns the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode's
current field values.
|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected static final java.lang.String UNUSED_POSITION_CODE
public SymbolCode()
null
.public SymbolCode(java.lang.String symCode)
See SymbolCode's class-level documentation for an overview of the supported MIL-STD-2525 symbol code fields.
symCode
- the symbol identification code to parse.java.lang.IllegalArgumentException
- if the symCode is null
or has a length other than 15.WWUnrecognizedException
- if any field in the symCode is invalid or cannot be recognized.public static void appendFieldValue(java.lang.StringBuilder sb, java.lang.String value, int length)
null
or empty, this appends unused characters to fill
the entire space used by the field.sb
- the StringBuilder representing a MIL-STD-2525 symbol identification code (SIDC).value
- the field value to append.length
- the number of positions used by the field in the SIDC.protected java.lang.String composeEmergencyManagementSymCode()
The Emergency Management coding scheme is defined in MIL-STD-2525C table G-I (page 1032).
protected java.lang.String composeIntelligenceSymCode()
The Signals Intelligence coding scheme is defined in MIL-STD-2525C table D-I (page 964).
protected java.lang.String composeMetocSymCode()
The Meteorological and Oceanographic coding scheme is defined in MIL-STD-2525C table C-I (page 763).
protected java.lang.String composeStabilityOperationsSymCode()
The Stability Operations coding scheme is defined in MIL-STD-2525C table E-I (page 991).
public static java.lang.String composeSymbolModifierCode(SymbolCode symbolCode, AVList modifiers, java.lang.String modifierKey)
protected java.lang.String composeSymCode()
This returns null
if this SymbolCode's Coding Scheme is null
or unrecognized.
null
if the Coding Scheme is unrecognized.protected java.lang.String composeTacticalGraphicsSymCode()
The Tactical Graphics coding scheme is defined in MIL-STD-2525C table B-I (page 305).
protected java.lang.String composeUnrecognizedSymCode()
null
indicating that this SymbolCode's Coding Scheme is not recognized.null
.protected java.lang.String composeWarfightingSymCode()
The Warfighting coding scheme is defined in MIL-STD-2525C table A-I (page 51).
public java.lang.String getBattleDimension()
null
.setBattleDimension(String)
public java.lang.String getCategory()
null
.setCategory(String)
public java.lang.String getCountryCode()
null
.setCountryCode(String)
public java.lang.String getEchelon()
null
.setEchelon(String)
public java.lang.String getFunctionId()
null
.setFunctionId(String)
public java.lang.String getGraphicType()
null
.setStaticDynamic(String)
public java.lang.String getOrderOfBattle()
null
.setOrderOfBattle(String)
public java.lang.String getScheme()
null
.setScheme(String)
public java.lang.String getStandardIdentity()
null
.setStandardIdentity(String)
public java.lang.String getStaticDynamic()
null
.setStaticDynamic(String)
public java.lang.String getStatus()
null
.setStatus(String)
public java.lang.String getSymbolModifier()
null
.setSymbolModifier(String)
public static boolean isFieldEmpty(java.lang.String value)
true
if the specified value is
null
, is the empty string, or is filled entirely with the unused character "-".value
- the value to test. May be null
.true
if the value is empty, and false
otherwise.protected boolean isUnitsAndEquipmentSymbolModifier(java.lang.String value)
value
- the modifier code to test. Must be non-null
and have length of 2 or greater. Any
characters after the 2nd character are ignored.true
if the specified code represents a units and equipment modifier code, and
false
otherwise.protected java.lang.String parseEmergencyManagementSymCode(java.lang.String symCode)
null
.
The Emergency Management coding scheme is defined in MIL-STD-2525C table G-I (page 1032).
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.null
if the symbol code is recognized, otherwise a non-null
string listing the
unrecognized symbol elements.protected java.lang.String parseIntelligenceSymCode(java.lang.String symCode)
null
.
The Signals Intelligence coding scheme is defined in MIL-STD-2525C table D-I (page 964).
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.null
if the symbol code is recognized, otherwise a non-null
string listing the
unrecognized symbol elements.protected java.lang.String parseMetocSymCode(java.lang.String symCode)
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.protected java.lang.String parseStabilityOperationsSymCode(java.lang.String symCode)
null
.
The Stability Operations coding scheme is defined in MIL-STD-2525C table E-I (page 991).
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.null
if the symbol code is recognized, otherwise a non-null
string listing the
unrecognized symbol elements.public static AVList parseSymbolModifierCode(java.lang.String code, AVList params)
Modifier | Key | Value |
---|---|---|
Echelon | SymbologyConstants.ECHELON | See
SymbologyConstants.ECHELON |
Headquarters | SymbologyConstants.HEADQUARTERS | Boolean.TRUE
or null |
Task Force | SymbologyConstants.TASK_FORCE | Boolean.TRUE or
null |
Feint/Dummy | SymbologyConstants.FEINT_DUMMY | Boolean.TRUE or
null |
Installation | SymbologyConstants.INSTALLATION | See SymbologyConstants.INSTALLATION |
Equipment Mobility | SymbologyConstants.MOBILITY | See
SymbologyConstants.MOBILITY |
Auxiliary Equipment | SymbologyConstants.AUXILIARY_EQUIPMENT | See
SymbologyConstants.AUXILIARY_EQUIPMENT |
Note that the installation modifier code indicates that an installation is either a normal installation or a feint/dummy installation. In the latter case, this also sets the modifier key SymbologyConstants.FEINT_DUMMY to Boolean.TRUE. This provides a consistent way to identify feint/dummy modifier status for both units/equipment and installations.
code
- the symbol modifier code to parse.params
- a parameter list in which to place the modifier key-value pairs, or null
to allocate
and return a new parameter list.protected java.lang.String parseSymCode(java.lang.String symCode)
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.null
if the symbol code is recognized, otherwise a non-null
string listing the
unrecognized symbol code fields.protected java.lang.String parseTacticalGraphicsSymCode(java.lang.String symCode)
null
.
The Tactical Graphics coding scheme is defined in MIL-STD-2525C table B-I (page 305).
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.null
if the symbol code is recognized, otherwise a non-null
string listing the
unrecognized symbol elements.protected java.lang.String parseUnrecognizedSymCode(java.lang.String symCode)
symCode
- the unknown symbol code.protected java.lang.String parseWarfightingSymCode(java.lang.String symCode)
null
.
The Warfighting coding scheme is defined in MIL-STD-2525C table A-I (page 51).
symCode
- the symbol code to parse. Must be non-null
and have length of 15 or greater. Any
characters after the 15th character are ignored.null
if the symbol code is recognized, otherwise a non-null
string listing the
unrecognized symbol code fields.public void setBattleDimension(java.lang.String value)
null
or one of the following:
value
- the new value for the Battle Dimension field. May be null
.public void setCategory(java.lang.String value)
Tactical Graphics
Stability Operations
Emergency Management
value
- the new value for the Category field. May be null
.public void setCountryCode(java.lang.String value)
value
- the new value for the Country Code field. May be null
.public void setEchelon(java.lang.String value)
null
or one of the following:
value
- the new value for the Echelon field. May be null
.public void setFunctionId(java.lang.String value)
value
- the new value for the Function ID field. May be null
.public void setGraphicType(java.lang.String value)
value
- the new value for the Graphic Type field. May be null
.public void setOrderOfBattle(java.lang.String value)
Warfighting, Signals Intelligence, Stability Operations, Emergency Management
Tactical Graphics
value
- the new value for the Order of Battle field. May be null
.public void setScheme(java.lang.String value)
null
or one of the following:
value
- the new value for the Coding Scheme field. May be null
.public void setStandardIdentity(java.lang.String value)
null
or one of the following:
value
- the new value for the Standard Identity field. May be null
.public void setStaticDynamic(java.lang.String value)
value
- the new value for the Static/Dynamic field. May be null
.public void setStatus(java.lang.String value)
Warfighting, Signals Intelligence, Stability Operations
Tactical Graphics
Emergency Management
value
- the new value for the Status/Operational Condition field. May be null
.public void setSymbolModifier(java.lang.String value)
value
- the new value for the Symbol Modifier field. May be null
.public java.lang.String toMaskedString()
public java.lang.String toString()
This returns null
if this SymbolCode's Coding Scheme is null
or unrecognized.
toString
in class java.lang.Object
null
if the Coding Scheme is unrecognized.