|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.tools.symbology.milStd2525.CodePosition
public class CodePosition
The CodePosition class is a base class used to interpret and organize role settings for a symbol. The SymbolCode describes a symbol and its role, with different characters having defined meanings and optional values, depending on the symbol. The CodePosition object defines a character and meaning for a character in a certain place. A SymbolPart refers to a particlar CodePosition that uniquely defines it, giving it some organizational meaning. SymbolParts that share a parent can get to the parent's CodePositin to see that meaning as well.
CodePositions have some intelligence for parsing position properties and hierarchy properties, which allow the whole symbol tree to be defined.
CodePositions server a couple of different roles. Some CodePosition objects organize the kinds of set values that may be applicable for a certain character position, and can offer those choices. These organizational CodePositions won't have a SymbolPart to represent itself. Other CodePositions, including the choices and those tied directly to SymbolParts in the SymbolPart tree, don't offer choices but can provide SymbolParts to represent themselves in the symbol.
Field Summary | |
---|---|
protected java.util.List |
choices
A list of CodePosition choices for this position. |
boolean |
DEBUG
|
protected int |
endIndex
|
protected int |
hierarchyNumber
|
protected java.lang.String |
id
|
static java.lang.String |
NameProperty
Property file property for pretty name 'name' |
protected CodePosition |
nextPosition
|
static java.lang.String |
NextProperty
Property file property for a classname representing the next position in the position tree 'next'. |
static char |
NO_CHAR
|
static int |
NO_NUMBER
|
protected java.lang.String |
prettyName
|
protected int |
startIndex
|
protected SymbolPart |
symbolPart
|
Constructor Summary | |
---|---|
CodePosition()
|
|
CodePosition(java.lang.String name,
int start,
int end)
|
Method Summary | |
---|---|
void |
addPositionChoice(CodePosition cp)
Add the CodePosition to the choices, creating the choices List if needed. |
protected CodePosition |
addPositionChoice(int index,
java.lang.String entry,
java.lang.String prefix,
java.util.Properties props)
Method to add a position to the choices for this particular code position. |
boolean |
codeMatches(java.lang.String queryCode)
A query method that answers of the given 15 digit code applies to this symbol part. |
int |
getEndIndex()
Get the ending index of the span that this position represents. |
CodePosition |
getFromChoices(int hierarchyNumber)
Get a CodePosition from this list of available possibilities given the hierarchy number for the position. |
int |
getHierarchyNumber()
The SymbolPart tree can be represented by a hierarchy number system, and this system is what is used in the hierarchy properties file to build the symbol tree. |
java.lang.String |
getHierarchyNumberString()
Return a string version of the hierarchy number. |
java.lang.String |
getID()
Get the character, in the symbol code, that this position represents. |
CodePosition |
getNextPosition()
Return the next CodePosition. |
protected CodePosition |
getNULLCodePosition()
|
java.util.List |
getPositionChoices()
Get the current list of CodePosition possibilities. |
java.lang.String |
getPrettyName()
Get the pretty name that states what this position and character represents. |
int |
getStartIndex()
Get the starting index of the span that this position represents. |
protected SymbolPart |
getSymbolPart(java.lang.String entry,
java.lang.String prefix,
java.util.Properties props)
A method called when parsing position properties. |
protected void |
parseHierarchy(java.lang.String hCode,
java.util.Properties props,
SymbolPart parent)
|
protected void |
parsePositions(java.lang.String prefix,
java.util.Properties props)
This method reads Properties to add choices to this class as options for what values are valid in this position. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char NO_CHAR
public static final int NO_NUMBER
protected int hierarchyNumber
protected java.lang.String id
protected java.lang.String prettyName
protected int startIndex
protected int endIndex
protected CodePosition nextPosition
protected SymbolPart symbolPart
public boolean DEBUG
public static final java.lang.String NameProperty
public static final java.lang.String NextProperty
protected java.util.List choices
Constructor Detail |
---|
public CodePosition()
public CodePosition(java.lang.String name, int start, int end)
Method Detail |
---|
public boolean codeMatches(java.lang.String queryCode)
queryCode
-
public java.util.List getPositionChoices()
public CodePosition getFromChoices(int hierarchyNumber)
protected CodePosition addPositionChoice(int index, java.lang.String entry, java.lang.String prefix, java.util.Properties props)
index
- the hierarchical index for this position choice.
This really only becomes important for those
CodePositions which are used for interpreting the
hierarchy properties. Other positions can use them for
convenience, and this value will probably be just an
ordering number for this choice out of all the other
choices for the position.entry
- this should be character or characters used in the
symbol code for this particular position choice.prefix
- the scoping property prefix used for all the
properties. The entry is discovered by looking in the
properties for this 'prefix.index'. Then other
properties are discovered by looking for
'prefix.entry.propertyKey' properties.props
- the position properties.public void addPositionChoice(CodePosition cp)
protected void parsePositions(java.lang.String prefix, java.util.Properties props)
protected SymbolPart getSymbolPart(java.lang.String entry, java.lang.String prefix, java.util.Properties props)
entry
- should be prefix of the overall position class
along with the symbol representation for that position.prefix
- should just be the prefix for the overall
position class, including the period before the symbol
representation for that position.props
- the position properties.protected void parseHierarchy(java.lang.String hCode, java.util.Properties props, SymbolPart parent)
public int getHierarchyNumber()
public java.lang.String getHierarchyNumberString()
public java.lang.String getID()
public java.lang.String getPrettyName()
public int getStartIndex()
public int getEndIndex()
public CodePosition getNextPosition()
public java.lang.String toString()
toString
in class java.lang.Object
protected CodePosition getNULLCodePosition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |