|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.portal.search.soif.AVPair
AVPair - a class used to represent a SOIF attribute-value pair.
SOIF AVPairs may be text or binary. Other types should be encoded by convention.
SOIF AVPairs may be multivalued.
This implementation will save data as either strings or byte arrays. If data is saved as a byte array, but requested as a string, an implicit conversion from binary to text is performed using the current character encoding. A conversion is also performed when an attribute is written in one encoding, but read in another.
NB: byte array entries are stored by reference and shared with caller. String entries are never shared.
SOIF
Field Summary | |
String |
attribute
Attribute name. |
com.sun.portal.search.soif.AVPair.AVValue[] |
value
Attribute value. |
Constructor Summary | |
AVPair(String att)
Constructs an empty, named AVPair instance |
|
AVPair(String att,
byte[] bval)
Constructs a new AVPairs instance with a byte array value. |
|
AVPair(String att,
byte[] bval,
int index)
Constructs an AVPair consisting of a byte array value with the given index. |
|
AVPair(String att,
byte[] bval,
int index,
String encoding)
Constructs an AVPair consisting of a String value with the given index and encoding. |
|
AVPair(String att,
String val)
Constructs a new AVPairs instance with a String value. |
|
AVPair(String att,
String val,
int index)
Constructs an AVPair consisting of a String value with the given index. |
Method Summary | |
int |
contentSize()
|
String |
getAttribute()
|
byte[] |
getBytes()
|
byte[] |
getBytes(int i)
|
byte[][] |
getByteValues()
Gets all valid values of this attribute. |
int |
getMaxIndex()
|
String[] |
getStringValues()
Gets all valid values of this attribute. |
String |
getValue()
|
String |
getValue(int i)
|
boolean |
insert(byte[] b,
int index)
Inserts a byte array at the given index, no duplicates. |
boolean |
insert(String v,
int index)
Inserts a String at the given index, no duplicates. |
boolean |
isMV()
|
boolean |
nthValid(int n)
|
boolean |
remove(int index)
Removes a mutivalued entry by index. |
boolean |
replace(byte[] b,
int index)
Replaces the byte array at the given index. |
boolean |
replace(String v,
int index)
Replaces the string at the given index. |
void |
setAttribute(String s)
(Re)names an AVPair. |
int |
size()
|
void |
squeeze()
Packs the index array by closing all holes towards the index zero. |
String |
toString()
|
int |
valueCount()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public String attribute
public com.sun.portal.search.soif.AVPair.AVValue[] value
Constructor Detail |
public AVPair(String att)
att
- the attributepublic AVPair(String att, String val)
att
- the attributeval
- the valuepublic AVPair(String att, byte[] bval)
att
- the attributeval
- the valuepublic AVPair(String att, String val, int index)
public AVPair(String att, byte[] bval, int index)
public AVPair(String att, byte[] bval, int index, String encoding)
Method Detail |
public boolean insert(String v, int index)
public boolean insert(byte[] b, int index)
public boolean replace(String v, int index)
public boolean replace(byte[] b, int index)
public boolean remove(int index)
public void squeeze()
public String getAttribute()
public void setAttribute(String s)
public String getValue()
public byte[] getBytes()
public String getValue(int i)
i
- multivalue indexpublic byte[] getBytes(int i)
i
- multivalue indexpublic int valueCount()
public int getMaxIndex()
public int size()
public String[] getStringValues()
public byte[][] getByteValues()
public boolean nthValid(int n)
public int contentSize()
public boolean isMV()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |