| java.lang.Object soif.SOIF
SOIF | public class SOIF implements Cloneable(Code) | | SOIF handling class.
The SOIF class is used as a list,
where each SOIF statement gets it's own node.
The first node is a header node
which has the full SOIF text in it,
the successor nodes have the variable but don't use it.
The SOIF list is created by creating the initial SOIF
instance and passing the SOIF string to it.
The full SOIF list is then created by running the parser
methods which iteratively create new SOIF instances (this
was originally done in a more elegant recursive fashion,
but that was a performance hog (passing the string).
|
Field Summary | |
protected String | URL The SOIF URL. | public AVPairs | list The attribute value pairs for this SOIF. | public SOIF | next Next SOIF object on list. | protected String | schemaName The SOIF schemaName. | protected boolean | valid Whether this is a valid SOIF object. |
Constructor Summary | |
public | SOIF() Constructor. | public | SOIF(String schemaName, String URL) Constructor. |
Method Summary | |
public void | addAVPairs(String att, String val) Adds a new AVPair to this list. | public int | attributeValueCount(String s) Get number of values for an attribute, e.g. | public int | count() Number of SOIF nodes in a list. | public AVPairs | getAVPairs() Get a copy of all the AVPairs. | public AVPairs | getAVPairsByAttribute(String s) Clone the AVPairs w/ the specified attribute. | public AVPairs | getAVPairsByMV(int mv) Clone the AVPairs w/ the specified MV. | public int | getAttributeCount() Get the number of unique attributes with this SOIF. | public String[] | getAttributes() Return a unique list of attributes w/out multi value,
e.g. | public int | getMaxAttributeIndex() Get the max attribute index (multivalue) from AVPairs list. | public String | getSchemaName() Return the schemaName. | public AVPairs | getSingleValuePairs() Return the pairs of the list that are not multivalue. | public String | getURL() Return the URL. | public String | getValue(String s) Find a value by non-multivalue attribute. | public String | getValue(String s, int n) Find a value by attribute and multivalue index. | public String[] | getValues(String s) Find a values by attribute. | public boolean | isValid() Whether a SOIF node is valid. | public boolean | setValue(String s, String v) Set a value by non-multivalue attribute. | public boolean | setValue(String s, int n, String v) Set a value by attribute and multivalue index. | public static String | toSOIF(String schemaName, String URL, String a, String v) Print out SOIF. | public String | toSOIFList() Return entire SOIF list as a string. | public String | toSOIFString() Return a single SOIF as a string. | public String | toString() Return a single SOIF as a string. | public String | toStringList() Return entire SOIF list as a string. | public AVPairs | unduplicateValues() Unduplicate values on the AVPairs list. |
list | public AVPairs list(Code) | | The attribute value pairs for this SOIF.
|
next | public SOIF next(Code) | | Next SOIF object on list.
|
schemaName | protected String schemaName(Code) | | The SOIF schemaName.
|
valid | protected boolean valid(Code) | | Whether this is a valid SOIF object.
|
SOIF | public SOIF()(Code) | | Constructor.
|
addAVPairs | public void addAVPairs(String att, String val) throws Exception(Code) | | Adds a new AVPair to this list.
Parameters: att - the attribute Parameters: val - the value |
attributeValueCount | public int attributeValueCount(String s)(Code) | | Get number of values for an attribute, e.g. if Bob has
Bob-1 and Bob-2, the answer is 2.
Ignores case of attribute name.
Parameters: s - the attribute |
count | public int count()(Code) | | Number of SOIF nodes in a list.
|
getAVPairs | public AVPairs getAVPairs()(Code) | | Get a copy of all the AVPairs.
|
getAVPairsByAttribute | public AVPairs getAVPairsByAttribute(String s)(Code) | | Clone the AVPairs w/ the specified attribute.
Parameters: s - attribute |
getAVPairsByMV | public AVPairs getAVPairsByMV(int mv)(Code) | | Clone the AVPairs w/ the specified MV.
Parameters: mv - multivalue value |
getAttributeCount | public int getAttributeCount()(Code) | | Get the number of unique attributes with this SOIF.
|
getAttributes | public String[] getAttributes()(Code) | | Return a unique list of attributes w/out multi value,
e.g. for Bob-1, Bob-2, Jim-1, return Bob, Jim.
|
getMaxAttributeIndex | public int getMaxAttributeIndex()(Code) | | Get the max attribute index (multivalue) from AVPairs list.
|
getSchemaName | public String getSchemaName()(Code) | | Return the schemaName.
|
getSingleValuePairs | public AVPairs getSingleValuePairs()(Code) | | Return the pairs of the list that are not multivalue.
|
getValue | public String getValue(String s)(Code) | | Find a value by non-multivalue attribute.
Ignores case of attribute name.
Parameters: s - the attribute |
getValue | public String getValue(String s, int n)(Code) | | Find a value by attribute and multivalue index.
Ignores case of attribute name.
Parameters: s - the attribute Parameters: n - the index |
getValues | public String[] getValues(String s)(Code) | | Find a values by attribute. Return an array of strings for
multiple values for an attribute, e.g., for Bob, return
values for Bob-1 and Bob-2.
Ignores case of attribute name.
Parameters: s - the attribute |
isValid | public boolean isValid()(Code) | | Whether a SOIF node is valid.
|
setValue | public boolean setValue(String s, String v)(Code) | | Set a value by non-multivalue attribute.
Ignores case of attribute name.
Parameters: s - the attribute |
setValue | public boolean setValue(String s, int n, String v)(Code) | | Set a value by attribute and multivalue index.
Ignores case of attribute name.
Parameters: s - the attribute Parameters: n - the index |
toSOIF | public static String toSOIF(String schemaName, String URL, String a, String v)(Code) | | Print out SOIF.
Parameters: schemaName - schema name Parameters: URL - URL Parameters: a - string array of attributes Parameters: v - string array of values exception: IllegalArgumentException - If att an val arrays not same size |
toString | public String toString()(Code) | | Return a single SOIF as a string.
|
toStringList | public String toStringList()(Code) | | Return entire SOIF list as a string.
|
unduplicateValues | public AVPairs unduplicateValues()(Code) | | Unduplicate values on the AVPairs list.
|
|
|