|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--rup.soif.AVPairs
A class to handle attribute/value pairs.
A SOIF attribute name may be multi-valued. For example, attributes "author-1" and "author-2" are treated as seperate instances of a single attribute, allowing the attribute to have more than one value.
| Field Summary | |
protected AVPairs |
next
Next AVPair. |
static int |
NOMULTIVALUE
No multivalue value. |
java.lang.String |
value
Value. |
| Constructor Summary | |
AVPairs(java.lang.String att,
java.lang.String val)
Constructs a new AVPairs instance. |
|
| Method Summary | |
boolean |
attributeNameExists(java.lang.String s)
Check to see if an attributeName exists on the list of AVPairs, regardless of multivalue: e.g. |
java.lang.String |
attributeValue()
Return the base attribute name. |
int |
attributeValueCount(java.lang.String s)
Get number of values for an attribute, e.g. if Bob has Bob-1 and Bob-2, the answer is 2. |
java.lang.Object |
clone()
|
int |
count()
Count AVPairs. |
java.lang.String |
getAttribute()
Get the attribute for this AVPair. |
int |
getAttributeCount()
Return a unique list of attributes w/out multi value, e.g. for Bob-1, Bob-2, Jim-1, return Bob, Jim. |
int |
getAttributeIndice()
Get the attribute indice for this AVPair. |
java.lang.String |
getAttributeName()
Get the attribute name for this AVPair. |
java.lang.String[] |
getAttributes()
Return a unique list of attributes w/out multi value, e.g. for Bob-1, Bob-2, Jim-1, return Bob, Jim. |
AVPairs |
getAVPair(java.lang.String s)
Get an avpair based on the attribute. |
AVPairs |
getAVPairsByAttribute(java.lang.String s)
Clone the AVPairs w/ the specified attribute. |
AVPairs |
getAVPairsByMV(int mv)
Clone the AVPairs w/ the specified MV. |
int |
getMaxAttributeIndice()
Get the maximum multivalue value. |
AVPairs |
getSingleValuePairs()
Return the pairs of the list that are not multivalue. |
java.lang.String |
getValue(java.lang.String s)
Find a value by nonmultivalue attribute. |
java.lang.String |
getValue(java.lang.String s,
int n)
Find a value by attribute and multivalue indice. |
java.lang.String[] |
getValues(java.lang.String s)
Find values by attribute. |
void |
insertAfter(AVPairs avPair)
Insert new AVPair after this instance. |
void |
insertAfter(java.lang.String att,
java.lang.String val)
Insert new AVPair after this instance. |
java.lang.String |
multiValueAttributeValue()
Return the multivalue or full attribute name. |
int |
multiValueValue()
Return the multivalue value. |
AVPairs |
remove(AVPairs avp)
Remove AVPairs instance from list. |
AVPairs |
remove(java.lang.String att)
Remove AVPairs instance from list. |
void |
setAttribute(java.lang.String att)
Set the attribute, do the multi-value parse. |
void |
setIndices(int indice)
Sets the indice of a multivalue attribute value pair. |
boolean |
setValue(java.lang.String s,
int n,
java.lang.String v)
Set a value by attribute and multivalue indice. |
boolean |
setValue(java.lang.String s,
java.lang.String v)
Set a value by nonmultivalue attribute. |
java.lang.String |
toCGIEqualStringList(boolean quoted)
Return "a = v" string version of AVPairs list, spaced. |
java.lang.String |
toEqualString(boolean quoted)
Return "a = v" string version of AVPairs instance. |
java.lang.String |
toSOIF()
Print out SOIF attribute value pair. |
java.lang.String |
toSOIF(int mv)
Print out SOIF attribute value pair. |
static java.lang.String |
toSOIF(java.lang.String a,
java.lang.String v)
Print out SOIF attribute value pair. |
java.lang.String |
toSOIFList()
Print out SOIF attribute value pair. |
java.lang.String |
toSOIFList(int mv)
Print out SOIF attribute value pair. |
java.lang.String |
toSpacedEqualStringList(boolean quoted)
Return "a = v" string version of AVPairs list, spaced. |
java.lang.String |
toString()
|
java.lang.String |
toStringList()
Return SOIF string version of AVPairs instance list. |
AVPairs |
unduplicateValues()
Unduplicate values on the AVPairs list. |
AVPairs |
update(java.lang.String att,
java.lang.String val)
A convenience method which bundles insert(), setValue() and remove(). |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public java.lang.String value
protected AVPairs next
public static final int NOMULTIVALUE
| Constructor Detail |
public AVPairs(java.lang.String att,
java.lang.String val)
att - the attributeval - the value| Method Detail |
public void setAttribute(java.lang.String att)
att - the attributepublic void setIndices(int indice)
indice - indice >= 0 or == NOMULTIVALUEpublic java.lang.Object clone()
public java.lang.String getAttribute()
public java.lang.String getAttributeName()
public int getAttributeIndice()
public boolean setValue(java.lang.String s,
java.lang.String v)
s - the attributev - the value
public boolean setValue(java.lang.String s,
int n,
java.lang.String v)
s - the attributen - the indicev - the valuepublic java.lang.String getValue(java.lang.String s)
s - the attribute
public java.lang.String getValue(java.lang.String s,
int n)
s - the attributen - the indicepublic java.lang.String[] getValues(java.lang.String s)
s - the attributepublic java.lang.String[] getAttributes()
public int getAttributeCount()
public int attributeValueCount(java.lang.String s)
s - the attributepublic int getMaxAttributeIndice()
public boolean attributeNameExists(java.lang.String s)
s - the attributepublic AVPairs getAVPair(java.lang.String s)
att - attributepublic AVPairs getAVPairsByMV(int mv)
mv - multivalue valuepublic AVPairs getAVPairsByAttribute(java.lang.String s)
s - attributepublic AVPairs unduplicateValues()
public AVPairs getSingleValuePairs()
public int count()
public void insertAfter(AVPairs avPair)
avPair - the new instance
public void insertAfter(java.lang.String att,
java.lang.String val)
att - attributeval - valuepublic AVPairs remove(AVPairs avp)
avp - node to nukepublic AVPairs remove(java.lang.String att)
att - attribute to nuke
public AVPairs update(java.lang.String att,
java.lang.String val)
att - attributeval - valuepublic java.lang.String attributeValue()
public int multiValueValue()
public java.lang.String multiValueAttributeValue()
public java.lang.String toString()
public java.lang.String toStringList()
public static java.lang.String toSOIF(java.lang.String a,
java.lang.String v)
a - attributev - valuepublic java.lang.String toSOIF()
public java.lang.String toSOIF(int mv)
mv - multi-valuepublic java.lang.String toSOIFList()
public java.lang.String toSOIFList(int mv)
mv - multi-valuepublic java.lang.String toEqualString(boolean quoted)
quoted - doublequote the value if truepublic java.lang.String toSpacedEqualStringList(boolean quoted)
quoted - doublequote the value if truepublic java.lang.String toCGIEqualStringList(boolean quoted)
quoted - doublequote the value if true
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||