at.ofai.gate.jape
Class JdmAttribute

java.lang.Object
  extended by at.ofai.gate.jape.JdmAttribute
All Implemented Interfaces:
java.io.Serializable

public class JdmAttribute
extends java.lang.Object
implements java.io.Serializable

THIS CLASS SHOULDN'T BE HERE. Please let's all ignore it, and maybe it will go away.

Implements the TIPSTER and GDM API for attributes. Test code in testAttributes class.

The JdmAttribute class would accept all java serialisable classes, all jdm classes and also all user-defined classes provided they implement the Serializable interface. This restriction is necessary since Jdm uses Java serialisation to ensure object persistency. However, making classes serialisable is usually quite straightforward.

Author:
Kalina Bontcheva
See Also:
Serialized Form

Constructor Summary
protected JdmAttribute()
           
  JdmAttribute(JdmAttribute jdmAttr)
          throws JdmException when the value isn't one of the types we know how to store, i.e., a serialisable or Jdm class.
  JdmAttribute(java.lang.String name, java.lang.Object value)
          Create a tuple for an attribute: (name, value, operator).
  JdmAttribute(java.lang.String name, java.lang.Object value, int operator)
          Create a tuple that describes an attribute: (name, value, operator).
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 int getOperator()
           
 java.lang.Object getValue()
           
 java.lang.String getValueType()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdmAttribute

protected JdmAttribute()

JdmAttribute

public JdmAttribute(java.lang.String name,
                    java.lang.Object value)
Create a tuple for an attribute: (name, value, operator). Operator is JapeConstants.EQUAL by default.

This constructor should be called when the attribute is part of an annotation in the document. When the attribute is part of a constraint in a grammar, use JdmAttribute(name, value, operator).

Parameters:
name - name of the attribute
value - value of the attribute

JdmAttribute

public JdmAttribute(java.lang.String name,
                    java.lang.Object value,
                    int operator)
Create a tuple that describes an attribute: (name, value, operator).

This constructor should be called when the attribute is part of a constraint in a grammar. When the attribute is part of an annotation in the document, use JdmAttribute(name, value);

Parameters:
name - name of the attribute
value - value of the attribute
operator - see JapeConstants (EQUAL, NOT_EQUAL...)

JdmAttribute

public JdmAttribute(JdmAttribute jdmAttr)
throws JdmException when the value isn't one of the types we know how to store, i.e., a serialisable or Jdm class.

Method Detail

getName

public java.lang.String getName()

getValue

public java.lang.Object getValue()

getValueType

public java.lang.String getValueType()

getOperator

public int getOperator()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object