|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.vinci.transport.FrameComponent
org.apache.vinci.transport.Frame
org.apache.vinci.transport.QueryableFrame
org.apache.vinci.transport.VinciFrame
public class VinciFrame
This is the "default" document class for use with the Vinci client and servable classes. VinciFrame implements a queryable frame from (nested) ArrayList data structures. Search time for a named tag is O(n) in the number of keys at a given depth, which is fine for all but the largest documents. VinciFrame complements the QueryableFrame adders and getters with several setter methods [fset(String, *)] for modifying the values of designated tags.
Constructor Summary | |
---|---|
VinciFrame()
Create a new empty VinciFrame. |
|
VinciFrame(int initialCapacity)
Create a new empty VinciFrame with the specified initial capacity. |
Method Summary | |
---|---|
void |
add(java.lang.String key,
FrameComponent val)
Implementation of the abstract Frame method. |
Frame |
createSubFrame(java.lang.String tag_name,
int initialCapacity)
Override the createSubFrame to create a VinciFrame of precise capacity. |
protected void |
ensureCapacity()
|
VinciFrame |
fdrop(java.lang.String key)
Remove all elements whose tag name matches the provided key (if any) from the top level of this frame. |
VinciFrame |
fdropFirst(java.lang.String key)
Remove only the first element whose tag name matches the specified key (if any) from the top level of this frame. |
java.util.ArrayList |
fget(java.lang.String key)
Implementation of the abstract fget method defined in QueryableFrame. |
FrameComponent |
fgetFirst(java.lang.String key)
Implementation of the abstract fgetFirst method defined in QueryableFrame. |
VinciFrame |
fgetVinciFrame(java.lang.String key)
Convenience method for fetching sub-frames when their type is known to be VinciFrame |
java.util.ArrayList |
fkeys()
Returns a ArrayList of all the keys at the top-level of this frame, removing any duplicates. |
void |
freset()
Reset this frame to an empty state. |
VinciFrame |
fset(java.lang.String key,
boolean val)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
byte[] bin)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
double val)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
Frame val)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
int val)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
int[] val)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
long val)
Change the value associated with the first occurence of the given key to val. |
VinciFrame |
fset(java.lang.String key,
java.lang.String val)
Change the value associated with first occurence of the given key to val. |
VinciFrame |
fsetTrueBinary(java.lang.String key,
byte[] bin)
Change the value associated with the first occurence of the given key to val. |
KeyValuePair |
getKeyValuePair(int which)
Implementation of the abstract Frame method. |
int |
getKeyValuePairCount()
Implementation of the abstract Frame method. |
static TransportableFactory |
getVinciFrameFactory()
Get a TransportableFactory that creates new VinciFrames. |
protected void |
set(java.lang.String key,
FrameComponent val)
Change the value associated with the first occurence of the given key to val. |
boolean |
stripWhitespace()
Recursively strip any raw PCDATA fields that are entirely whitespace. |
static VinciFrame |
toVinciFrame(Transportable t)
Create a VinciFrame that is a (deep) copy of the given transportable. |
Methods inherited from class org.apache.vinci.transport.QueryableFrame |
---|
fgetBoolean, fgetBytes, fgetDouble, fgetDoubleArray, fgetFloat, fgetFloatArray, fgetFrame, fgetInt, fgetIntArray, fgetLong, fgetLongArray, fgetString, fgetStringArray, fgetTrueBinary |
Methods inherited from class org.apache.vinci.transport.Frame |
---|
createFrameLeaf, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, faddTrueBinary, fromStream, getFrameTransporter, setFrameTransporter, toRawXML, toRawXML, toRawXMLWork, toStream, toString, toXML, toXML, toXML |
Methods inherited from class org.apache.vinci.transport.FrameComponent |
---|
getAttributes, setAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VinciFrame()
public VinciFrame(int initialCapacity)
initialCapacity
- the capacity value to be passed on to the internal ArrayList used for holding
KeyValuePairs.Method Detail |
---|
public static TransportableFactory getVinciFrameFactory()
public static VinciFrame toVinciFrame(Transportable t)
public java.util.ArrayList fkeys()
public java.util.ArrayList fget(java.lang.String key)
fget
in class QueryableFrame
key
- The key identifying the values to retrieve.
public FrameComponent fgetFirst(java.lang.String key)
fgetFirst
in class QueryableFrame
key
- The key identifying the value to retrieve.
public Frame createSubFrame(java.lang.String tag_name, int initialCapacity)
createSubFrame
in class Frame
public VinciFrame fgetVinciFrame(java.lang.String key)
key
- The key identifying the value to retrieve.
java.lang.ClassCastException
- (unchecked) if the value was not of type VinciFrame.public VinciFrame fset(java.lang.String key, java.lang.String val)
java.lang.NullPointerException
- if val is null.public VinciFrame fset(java.lang.String key, long val)
public VinciFrame fset(java.lang.String key, boolean val)
public VinciFrame fset(java.lang.String key, int val)
public VinciFrame fset(java.lang.String key, int[] val)
public VinciFrame fset(java.lang.String key, Frame val)
java.lang.NullPointerException
- if val is null.public VinciFrame fset(java.lang.String key, double val)
public VinciFrame fset(java.lang.String key, byte[] bin)
java.lang.NullPointerException
- if bin is null.public VinciFrame fsetTrueBinary(java.lang.String key, byte[] bin)
java.lang.NullPointerException
- if bin is null.protected void set(java.lang.String key, FrameComponent val)
java.lang.NullPointerException
- if val is null.public VinciFrame fdropFirst(java.lang.String key)
key
- The tag name of the element to remove.
public VinciFrame fdrop(java.lang.String key)
key
- The tag name of the elements to remove.
public void freset()
public void add(java.lang.String key, FrameComponent val)
add
in class Frame
key
- The tag name with which to associate the value.val
- The (Frame | FrameLeaf) value to associate with the tag.protected void ensureCapacity()
public KeyValuePair getKeyValuePair(int which)
getKeyValuePair
in class Frame
which
- The index of the KeyValuePair to retrieve.
public int getKeyValuePairCount()
getKeyValuePairCount
in class Frame
public boolean stripWhitespace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |