CAR (Context-Aware Retrieval) v1.0

Class AttributeTuple

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--AttributeTuple
All Implemented Interfaces:
CarFace, java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class AttributeTuple
extends java.util.Vector
implements java.io.Serializable, CarFace

An AttributeTuple is a vector of Attributes.

See the Basic Terminology section of the User Manual for a description and how AttributeTuples form part of CAR's data structure..

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface CarFace
BOOLEAN_LITERAL, COLLECTION, DOUBLE_LITERAL, EXTERNAL, grammarNames, INTERNAL, KEYPHRASE, LITERALcapacityIncrement, LITERALinitialCapacity, MARKUP, SERIAL, SESSION, STRING_LITERAL, STRINGVALUE_LITERAL
 
Constructor Summary
AttributeTuple()
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getValue(java.lang.String name)
          gets the value of the name="value" attribute pair, using the provided name.
 boolean hasAttribute(java.lang.String name)
          indicates whether the named attribute exists within this object (case of name is unimportant)
 int numberOfAttributes()
          returns the number of Attributes in the AttributeTuple
 void removeAttribute(java.lang.String name)
          removes the attribute with the provided name.
 boolean same(AttributeTuple at)
          indicates whether this AttributeTuple contains the same attributeTuple (same name=value pairs - order insignificant) as the provided one
 void setAttribute(java.lang.String name, java.lang.String value)
          sets an attribute to the given name="value" pair.
static void t(java.lang.String s)
          Provides trace output of string if -dAttributeTuple on command line of CAR run
 java.lang.String toString()
          converts the object to a string.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

AttributeTuple

public AttributeTuple()
Method Detail

t

public static final void t(java.lang.String s)
Provides trace output of string if -dAttributeTuple on command line of CAR run

clone

public java.lang.Object clone()
Overrides:
clone in class java.util.Vector

numberOfAttributes

public int numberOfAttributes()
returns the number of Attributes in the AttributeTuple

getValue

public java.lang.String getValue(java.lang.String name)
gets the value of the name="value" attribute pair, using the provided name.
Returns:
string value (or null if an attribute with the provided name does not exist)

removeAttribute

public void removeAttribute(java.lang.String name)
removes the attribute with the provided name. No action if an attribute with the provided name does not exist.
Parameters:
name - the name of an attribute.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
sets an attribute to the given name="value" pair. If the named attribute already exists its value is overwritten, otherwise the new Attribute is added to the end of the ValueTuple.

same

public boolean same(AttributeTuple at)
indicates whether this AttributeTuple contains the same attributeTuple (same name=value pairs - order insignificant) as the provided one

hasAttribute

public boolean hasAttribute(java.lang.String name)
indicates whether the named attribute exists within this object (case of name is unimportant)

toString

public java.lang.String toString()
converts the object to a string. The format of the string is consistent with the textual representation of an AttributeTuple, as read from file by CAR.
Overrides:
toString in class java.util.Vector
Returns:
a string represention of the AttributeTuple.

CAR (Context-Aware Retrieval) v1.0

Submit bugs to Lindsey