Class SymbolCode
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.symbology.milstd2525.SymbolCode
-
- All Implemented Interfaces:
AVList
public class SymbolCode extends AVListImpl
SymbolCode provides a utility for parsing and representing the individual fields of a MIL-STD-2525 symbol identification code (SIDC). A SymbolCode can either be created by parsing a 15-character symbol code string or by creating an empty SymbolCode and manually specifying its fields.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:
- Coding Scheme
- Standard Identity
- Battle Dimension
- Category
- Function ID
- Symbol Modifier
- Echelon
- Status
- Country Code
- Order of Battle
Which fields are populated after parsing a symbol code depends on the MIL-STD-2525 symbology set the symbol code belongs to:
Populated Fields 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
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor 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).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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()
Returnsnull
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.-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
-
-
-
-
Field Detail
-
UNUSED_POSITION_CODE
protected static final java.lang.String UNUSED_POSITION_CODE
Indicates the character for an unused position in a MIL-STD-2525 symbol identification code- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SymbolCode
public SymbolCode()
Creates a new symbol code, but otherwise does nothing. All fields are initialized tonull
.
-
SymbolCode
public 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). This populates the new SymbolCode's fields according to the contents of the string. This throws an exception if any field in the symbol code is unrecognized, and indicates the problematic fields in the exception's message. After construction, each field can be accessed by calling the appropriate accessor methods (for example: getScheme/setScheme)See SymbolCode's class-level documentation for an overview of the supported MIL-STD-2525 symbol code fields.
- Parameters:
symCode
- the symbol identification code to parse.- Throws:
java.lang.IllegalArgumentException
- if the symCode isnull
or has a length other than 15.WWUnrecognizedException
- if any field in the symCode is invalid or cannot be recognized.
-
-
Method Detail
-
getScheme
public java.lang.String getScheme()
Indicates this symbol code's Coding Scheme field.- Returns:
- the value of the Coding Scheme field. May be
null
. - See Also:
setScheme(String)
-
setScheme
public void setScheme(java.lang.String value)
Specifies this symbol code's Coding Scheme field. A symbol code's Coding Scheme defines the specific MIL-STD-2525 symbology set that it belongs to. The value must benull
or one of the following:- SCHEME_WARFIGHTING
- SCHEME_TACTICAL_GRAPHICS
- SCHEME_METOC
- SCHEME_INTELLIGENCE
- SCHEME_STABILITY_OPERATIONS
- SCHEME_EMERGENCY_MANAGEMENT
- Parameters:
value
- the new value for the Coding Scheme field. May benull
.
-
getStandardIdentity
public java.lang.String getStandardIdentity()
Indicates this symbol code's Standard Identity field.- Returns:
- the value of the Standard Identity field. May be
null
. - See Also:
setStandardIdentity(String)
-
setStandardIdentity
public void setStandardIdentity(java.lang.String value)
Specifies this symbol code's Standard Identity field. A symbol code's Standard Identity defines the threat posed by the object being represented. The value must benull
or one of the following:- STANDARD_IDENTITY_PENDING
- STANDARD_IDENTITY_UNKNOWN
- STANDARD_IDENTITY_ASSUMED_FRIEND
- STANDARD_IDENTITY_FRIEND
- STANDARD_IDENTITY_NEUTRAL
- STANDARD_IDENTITY_SUSPECT
- STANDARD_IDENTITY_HOSTILE
- STANDARD_IDENTITY_EXERCISE_PENDING
- STANDARD_IDENTITY_EXERCISE_UNKNOWN
- STANDARD_IDENTITY_EXERCISE_ASSUMED_FRIEND
- STANDARD_IDENTITY_EXERCISE_FRIEND
- STANDARD_IDENTITY_EXERCISE_NEUTRAL
- STANDARD_IDENTITY_JOKER
- STANDARD_IDENTITY_FAKER
- Parameters:
value
- the new value for the Standard Identity field. May benull
.
-
getBattleDimension
public java.lang.String getBattleDimension()
Indicates this symbol code's Battle Dimension field.- Returns:
- the value of the Battle Dimension field. May be
null
. - See Also:
setBattleDimension(String)
-
setBattleDimension
public void setBattleDimension(java.lang.String value)
Specifies this symbol code's Battle Dimension field. A symbol code's Battle Dimension defines the primary mission area for the object being represented. The value must benull
or one of the following:- BATTLE_DIMENSION_SPACE
- BATTLE_DIMENSION_AIR
- BATTLE_DIMENSION_GROUND
- BATTLE_DIMENSION_SEA_SURFACE
- BATTLE_DIMENSION_SEA_SUBSURFACE
- BATTLE_DIMENSION_SOF
- BATTLE_DIMENSION_OTHER
- Parameters:
value
- the new value for the Battle Dimension field. May benull
.
-
getCategory
public java.lang.String getCategory()
Indicates this symbol code's Category field.- Returns:
- the value of the Category field. May be
null
. - See Also:
setCategory(String)
-
setCategory
public void setCategory(java.lang.String value)
Specifies this symbol code's Category field. The meaning of a symbol code's Category and the recognized values depend on the specific MIL-STD-2525 symbology scheme the symbol code belongs to:Tactical Graphics
- CATEGORY_TASKS
- CATEGORY_COMMAND_CONTROL_GENERAL_MANEUVER
- CATEGORY_MOBILITY_SURVIVABILITY
- CATEGORY_FIRE_SUPPORT
- CATEGORY_COMBAT_SERVICE_SUPPORT
- CATEGORY_OTHER
Stability Operations
- CATEGORY_VIOLENT_ACTIVITIES
- CATEGORY_LOCATIONS
- CATEGORY_OPERATIONS
- CATEGORY_ITEMS
- CATEGORY_INDIVIDUAL
- CATEGORY_NONMILITARY_GROUP_ORGANIZATION
- CATEGORY_RAPE
Emergency Management
- CATEGORY_INCIDENT
- CATEGORY_NATURAL_EVENTS
- CATEGORY_OPERATIONS
- CATEGORY_INFRASTRUCTURE
- Parameters:
value
- the new value for the Category field. May benull
.
-
getStatus
public java.lang.String getStatus()
Indicates this symbol code's Status/Operational Condition field.- Returns:
- the value of the Status/Operational Condition field. May be
null
. - See Also:
setStatus(String)
-
setStatus
public void setStatus(java.lang.String value)
Specifies this symbol code's Status/Operational Condition field. A symbol code's Status defines whether the represented object exists at the time the symbol was generated, or is anticipated to exist in the future. Additionally, a symbol code's Status can define its operational condition. The recognized values depend on the specific MIL-STD-2525 symbology scheme the symbol code belongs to:Warfighting, Signals Intelligence, Stability Operations
- STATUS_ANTICIPATED
- STATUS_PRESENT
- STATUS_PRESENT_FULLY_CAPABLE
- STATUS_PRESENT_DAMAGED
- STATUS_PRESENT_DESTROYED
- STATUS_PRESENT_FULL_TO_CAPACITY
Tactical Graphics
- STATUS_ANTICIPATED
- STATUS_SUSPECTED
- STATUS_PRESENT
- STATUS_KNOWN
Emergency Management
- STATUS_ANTICIPATED
- STATUS_PRESENT
- Parameters:
value
- the new value for the Status/Operational Condition field. May benull
.
-
getFunctionId
public java.lang.String getFunctionId()
Indicates this symbol code's Function ID field.- Returns:
- the value of the Function ID field. May be
null
. - See Also:
setFunctionId(String)
-
setFunctionId
public void setFunctionId(java.lang.String value)
Specifies this symbol code's Function ID field. The Function IDs are unique to each symbology schemes that uses them, and are defined in each appendix of the MIL-STD-2525C specification:- Warfighting - section A.5.2.1.e (page 51) and table A-I (page 51)
- Tactical Graphics - section B.5.2.1.e (page 304) and table B-I (page 305)
- Meteorological and Oceanographic - section C.5.2.1.d (page 763) and table C-I (page 763)
- Signals Intelligence - section D.5.2.1.e (page 964) and table D-I (page 964)
- Stability Operations - section E.5.2.1.e (page 991) and table E-I (page 991)
- Emergency Management - table G-I (page 1032)
- Parameters:
value
- the new value for the Function ID field. May benull
.
-
getSymbolModifier
public java.lang.String getSymbolModifier()
Indicates this symbol code's Symbol Modifier field.- Returns:
- the value of the Symbol Modifier field. May be
null
. - See Also:
setSymbolModifier(String)
-
setSymbolModifier
public void setSymbolModifier(java.lang.String value)
Specifies this symbol code's Symbol Modifier field. The Symbol Modifier defines what graphic symbol modifiers should be displayed around the symbol's icon such as echelon, headquarters, task force, feint/dummy, installation, equipment mobility, and auxiliary equipment. The recognized values depend on the specific MIL-STD-2525 symbology scheme the symbol code belongs to, and are defined in each appendix of the MIL-STD-2525C specification:- Warfighting - section A.5.2.1.f (page 51) and table A-II (pages 52-54)
- Stability Operations - section E.5.2.1.f (page 991) and table E-II (pages 992-994)
- Emergency Management - section G.5.5 (page 1029) and table EG-II (page 1032)
- Parameters:
value
- the new value for the Symbol Modifier field. May benull
.
-
getEchelon
public java.lang.String getEchelon()
Indicates this symbol code's Echelon field.- Returns:
- the value of the Echelon field. May be
null
. - See Also:
setEchelon(String)
-
setEchelon
public void setEchelon(java.lang.String value)
Specifies this symbol code's Echelon field. A symbol code's Echelon defines the command level of a unit represented by the symbol. The value must benull
or one of the following:- ECHELON_TEAM_CREW
- ECHELON_SQUAD
- ECHELON_SECTION
- ECHELON_PLATOON_DETACHMENT
- ECHELON_COMPANY_BATTERY_TROOP
- ECHELON_BATTALION_SQUADRON
- ECHELON_REGIMENT_GROUP
- ECHELON_BRIGADE
- ECHELON_DIVISION
- ECHELON_CORPS
- ECHELON_ARMY
- ECHELON_ARMY_GROUP_FRONT
- ECHELON_REGION
- ECHELON_COMMAND
- Parameters:
value
- the new value for the Echelon field. May benull
.
-
getCountryCode
public java.lang.String getCountryCode()
Indicates this symbol code's Country Code field.- Returns:
- the value of the Country Code field. May be
null
. - See Also:
setCountryCode(String)
-
setCountryCode
public void setCountryCode(java.lang.String value)
Specifies this symbol code's Country Code field. See ISO 3166-1 for a definition of valid Country Codes. The Country Codes are the same for all symbology schemes that use them.- Parameters:
value
- the new value for the Country Code field. May benull
.
-
getOrderOfBattle
public java.lang.String getOrderOfBattle()
Indicates this symbol code's Order of Battle field.- Returns:
- the value of the Order of Battle field. May be
null
. - See Also:
setOrderOfBattle(String)
-
setOrderOfBattle
public void setOrderOfBattle(java.lang.String value)
Specifies this symbol code's Order of Battle field. A symbol code's Order of Battle provides additional information about the symbol in the operational environment. The recognized values depend on the specific MIL-STD-2525 symbology scheme the symbol code belongs to:Warfighting, Signals Intelligence, Stability Operations, Emergency Management
- ORDER_OF_BATTLE_AIR
- ORDER_OF_BATTLE_ELECTRONIC
- ORDER_OF_BATTLE_CIVILIAN
- ORDER_OF_BATTLE_GROUND
- ORDER_OF_BATTLE_MARITIME
- ORDER_OF_BATTLE_STRATEGIC_FORCE_RELATED
Tactical Graphics
- ORDER_OF_BATTLE_CONTROL_MARKINGS
- Parameters:
value
- the new value for the Order of Battle field. May benull
.
-
getStaticDynamic
public java.lang.String getStaticDynamic()
Indicates this symbol code's Static/Dynamic field.- Returns:
- the value of the Static/Dynamic Condition field. May be
null
. - See Also:
setStaticDynamic(String)
-
setStaticDynamic
public void setStaticDynamic(java.lang.String value)
Specifies this symbol code's Static/Dynamic field. This field is used by graphics in the Meteorological and Oceanographic scheme. Valid values are STATIC and DYNAMIC.- Parameters:
value
- the new value for the Static/Dynamic field. May benull
.
-
getGraphicType
public java.lang.String getGraphicType()
Indicates this symbol code's Graphic Type field.- Returns:
- the value of the Graphic Type field. May be
null
. - See Also:
setStaticDynamic(String)
-
setGraphicType
public void setGraphicType(java.lang.String value)
Specifies this symbol code's Graphic Type field. This field is used by graphics in the Meteorological and Oceanographic scheme. Valid values are GRAPHIC_TYPE_POINT, GRAPHIC_TYPE_LINE, GRAPHIC_TYPE_AREA.- Parameters:
value
- the new value for the Graphic Type field. May benull
.
-
toString
public java.lang.String toString()
Returns the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode's current field values. Fields that are not part of this SymbolCode's current Coding Scheme are ignored. Fields that are unspecified or null are replaced with the MIL-STD-2525 unused position character "-". Field values are either padded or trimmed to fit their portion of the symbol code, adding unused characters to pad or ignoring extra characters to trim.This returns
null
if this SymbolCode's Coding Scheme isnull
or unrecognized.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, or
null
if the Coding Scheme is unrecognized.
-
toMaskedString
public 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. This method masks out the Standard Identity, Status, Echelon, Symbol Modifier, Country Code, and Order Of Battle fields. For example, the masked version of "GFGPGPAD---AUSX" is "G-F-GPAD-------".- Returns:
- String representation of the symbol code with some fields replaced with hyphens.
-
parseSymbolModifierCode
public static AVList parseSymbolModifierCode(java.lang.String code, AVList params)
Computes and returns the modifier key-value pairs associated with the specified SymbolModifier code. This recognizes modifier codes used by the Warfighting, Stability Operations, and Emergency Management symbology schemes: echelon, headquarters, task force, feint/dummy, installation, equipment mobility, and auxiliary equipment. This adds modifier keys only for those modifiers present in the SymbolModifier field. Any modifiers not in the SymbolModifier field are ignored. The following key-value pairs are used to indicate each modifier:Key Value Pairs 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.
- Parameters:
code
- the symbol modifier code to parse.params
- a parameter list in which to place the modifier key-value pairs, ornull
to allocate and return a new parameter list.- Returns:
- a parameter list containing the modifier key-value pairs.
-
composeSymbolModifierCode
public static java.lang.String composeSymbolModifierCode(SymbolCode symbolCode, AVList modifiers, java.lang.String modifierKey)
-
parseSymCode
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. Fields that are either not part of the specified symbol code or are unspecified are left unchanged.- Parameters:
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.- Returns:
null
if the symbol code is recognized, otherwise a non-null
string listing the unrecognized symbol code fields.
-
parseUnrecognizedSymCode
protected java.lang.String parseUnrecognizedSymCode(java.lang.String symCode)
Returns a error string indicating that the symbol code's scheme is not recognized.- Parameters:
symCode
- the unknown symbol code.- Returns:
- an error string.
-
parseWarfightingSymCode
protected java.lang.String parseWarfightingSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Warfighting coding scheme. Warfighting symbol codes contain the following fields: Coding Scheme, Standard Identity, Battle Dimension, Status, Function ID, Symbol Modifier, Country Code, Order of Battle. All fields except Function ID, Symbol Modifier, Country Code and Order of Battle must be non-null
.The Warfighting coding scheme is defined in MIL-STD-2525C table A-I (page 51).
- Parameters:
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.- Returns:
null
if the symbol code is recognized, otherwise a non-null
string listing the unrecognized symbol code fields.
-
parseTacticalGraphicsSymCode
protected java.lang.String parseTacticalGraphicsSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Tactical Graphics coding scheme. Tactical Graphic symbol codes contain the following fields: Coding Scheme, Standard Identity, Category, Status, Function ID, Echelon, Country Code, Order of Battle. All fields except Function ID, Echelon, Country Code and Order of Battle must be non-null
.The Tactical Graphics coding scheme is defined in MIL-STD-2525C table B-I (page 305).
- Parameters:
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.- Returns:
null
if the symbol code is recognized, otherwise a non-null
string listing the unrecognized symbol elements.
-
parseMetocSymCode
protected java.lang.String parseMetocSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Meteorological and Oceanographic coding scheme. METOC symbol codes are not currently supported, and this returns a string indicating that the scheme is unrecognized.- Parameters:
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.- Returns:
- an error string.
-
parseIntelligenceSymCode
protected java.lang.String parseIntelligenceSymCode(java.lang.String symCode)
Parses symbol codes encoded for the Signals Intelligence coding scheme. Signals Intelligence symbol codes contain the following fields: Scheme, Standard Identity, Battle Dimension, Status, Function ID, Country Code, Order of Battle. All fields except Function ID, Country Code and Order of Battle must be non-null
.The Signals Intelligence coding scheme is defined in MIL-STD-2525C table D-I (page 964).
- Parameters:
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.- Returns:
null
if the symbol code is recognized, otherwise a non-null
string listing the unrecognized symbol elements.
-
parseStabilityOperationsSymCode
protected java.lang.String parseStabilityOperationsSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Stability Operations coding scheme. Stability Operations symbol codes contain the following fields: Scheme, Standard Identity, Category, Status, Function ID, Symbol Modifier, Country Code, Order of Battle. All fields except Function ID, Symbol Modifier, Country Code and Order of Battle must be non-null
.The Stability Operations coding scheme is defined in MIL-STD-2525C table E-I (page 991).
- Parameters:
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.- Returns:
null
if the symbol code is recognized, otherwise a non-null
string listing the unrecognized symbol elements.
-
parseEmergencyManagementSymCode
protected java.lang.String parseEmergencyManagementSymCode(java.lang.String symCode)
Parses a symbol code encoded in the Emergency Management coding scheme. Emergency Management symbol codes contain the following fields: Scheme, Standard Identity, Category, Status, Function ID, Symbol Modifier, Country Code, Order of Battle. All fields except Function ID, Symbol Modifier, Country Code and Order of Battle must be non-null
.The Emergency Management coding scheme is defined in MIL-STD-2525C table G-I (page 1032).
- Parameters:
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.- Returns:
null
if the symbol code is recognized, otherwise a non-null
string listing the unrecognized symbol elements.
-
isUnitsAndEquipmentSymbolModifier
protected boolean isUnitsAndEquipmentSymbolModifier(java.lang.String value)
Indicates whether the specified 2-character Symbol Modifier code represents a units and equipment symbol modifier code.- Parameters:
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.- Returns:
true
if the specified code represents a units and equipment modifier code, andfalse
otherwise.
-
composeSymCode
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. Fields that are not part of this SymbolCode's current Coding Scheme are ignored. Fields that are unspecified or null are replaced with the MIL-STD-2525 unused position character "-". Field values are either padded or trimmed to fit their portion of the symbol code, adding unused characters to pad or ignoring extra characters to trim.This returns
null
if this SymbolCode's Coding Scheme isnull
or unrecognized.- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, or
null
if the Coding Scheme is unrecognized.
-
composeUnrecognizedSymCode
protected java.lang.String composeUnrecognizedSymCode()
Returnsnull
indicating that this SymbolCode's Coding Scheme is not recognized.- Returns:
null
.
-
composeWarfightingSymCode
protected java.lang.String composeWarfightingSymCode()
Composes a 15-character symbol identification code (SIDC) for the Warfighting coding scheme. Warfighting symbol codes contain the following fields: Coding Scheme, Standard Identity, Battle Dimension, Status, Function ID, Symbol Modifier, Country Code, Order of Battle.The Warfighting coding scheme is defined in MIL-STD-2525C table A-I (page 51).
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, according to the Warfighting coding scheme.
-
composeTacticalGraphicsSymCode
protected java.lang.String composeTacticalGraphicsSymCode()
Composes a 15-character symbol identification code (SIDC) for the Tactical Graphics coding scheme. Tactical Graphics symbol codes contain the following fields: Coding Scheme, Standard Identity, Category, Status, Function ID, Echelon, Country Code, Order of Battle.The Tactical Graphics coding scheme is defined in MIL-STD-2525C table B-I (page 305).
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, according to the Tactical Graphics coding scheme.
-
composeMetocSymCode
protected java.lang.String composeMetocSymCode()
Composes a 15-character symbol identification code (SIDC) for the Meteorological and Oceanographic coding scheme. METOC symbol codes contain the following fields: Coding Scheme, Category, Static/Dynamic, Function ID, Graphic Type.The Meteorological and Oceanographic coding scheme is defined in MIL-STD-2525C table C-I (page 763).
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, according to the METOC coding scheme.
-
composeIntelligenceSymCode
protected java.lang.String composeIntelligenceSymCode()
Composes a 15-character symbol identification code (SIDC) for the Signals Intelligence coding scheme. Signals Intelligence symbol codes contain the following fields: Scheme, Standard Identity, Battle Dimension, Status, Function ID, Country Code, Order of Battle.The Signals Intelligence coding scheme is defined in MIL-STD-2525C table D-I (page 964).
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, according to the Signals Intelligence coding scheme.
-
composeStabilityOperationsSymCode
protected java.lang.String composeStabilityOperationsSymCode()
Composes a 15-character symbol identification code (SIDC) for the Stability Operations coding scheme. Stability Operations symbol codes contain the following fields: Scheme, Standard Identity, Category, Status, Function ID, Symbol Modifier, Country Code, Order of Battle.The Stability Operations coding scheme is defined in MIL-STD-2525C table E-I (page 991).
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, according to the Stability Operations coding scheme.
-
composeEmergencyManagementSymCode
protected java.lang.String composeEmergencyManagementSymCode()
Composes a 15-character symbol identification code (SIDC) for the Emergency Management coding scheme. Emergency Management symbol codes contain the following fields: Standard Identity, Category, Status, Function ID, Symbol Modifier, Country Code, Order of Battle.The Emergency Management coding scheme is defined in MIL-STD-2525C table G-I (page 1032).
- Returns:
- the MIL-STD-2525 15-character symbol identification code (SIDC) corresponding to this SymbolCode, according to the Emergency Management coding scheme.
-
appendFieldValue
public 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. If the value is shorter than the specified length, this appends the MIL-STD-2525 unused character "-" to fill the unused characters. If the value is longer than the specified length, this ignores the extra characters. If the value isnull
or empty, this appends unused characters to fill the entire space used by the field.- Parameters:
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.
-
isFieldEmpty
public static boolean isFieldEmpty(java.lang.String value)
Indicates whether the specified field value is empty. This returnstrue
if the specified value isnull
, is the empty string, or is filled entirely with the unused character "-".- Parameters:
value
- the value to test. May benull
.- Returns:
true
if the value is empty, andfalse
otherwise.
-
-