inpro.dm.acts
Class ArgumentStruct

java.lang.Object
  extended by inpro.dm.acts.ArgumentStruct

public class ArgumentStruct
extends java.lang.Object

A convenience class for bundling intransitive, transitive, ditransitive argument structures for use in dialogue acts. Arguments are simple String representations.

Author:
okko

Field Summary
private  java.lang.String arg1
          The arguments
private  java.lang.String arg2
           
 
Constructor Summary
ArgumentStruct(ArgumentStruct as)
          Copy constructor
ArgumentStruct(java.lang.String arg)
          Transitive argument constructor
ArgumentStruct(java.lang.String arg1, java.lang.String arg2)
          Ditransitive argument constructor
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares this argument structure with another.
 java.lang.String getArg1()
          Getter for this structure's first argument
 java.lang.String getArg2()
          Getter for this structure's second argument
 int hashCode()
           
 boolean isDitransitive()
          Checks of this structure is transitive
 boolean isIntransitive()
          Checks if this structure is intransitive
 boolean isTransitive()
          Checks of this structure is transitive
 boolean resetArgumentfromAVPair(AVPair avp)
          Attempts replacing the arguments of this structure from an AVPair.
 void setArg1(java.lang.String arg)
          Setter for this structure's first argument
 void setArg2(java.lang.String arg)
          Setter for this structure's second argument
 java.lang.String toString()
          Builds a string representation of this arguemnt structure.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

arg1

private java.lang.String arg1
The arguments


arg2

private java.lang.String arg2
Constructor Detail

ArgumentStruct

public ArgumentStruct(java.lang.String arg)
Transitive argument constructor

Parameters:
arg -

ArgumentStruct

public ArgumentStruct(java.lang.String arg1,
                      java.lang.String arg2)
Ditransitive argument constructor

Parameters:
arg1 - the first argument
arg2 - the second argument

ArgumentStruct

public ArgumentStruct(ArgumentStruct as)
Copy constructor

Parameters:
as - the argument structure to copy.
Method Detail

isTransitive

public boolean isTransitive()
Checks of this structure is transitive

Returns:
true if only the first argument is initialized, else false

isDitransitive

public boolean isDitransitive()
Checks of this structure is transitive

Returns:
true if both arguments are initialized, else false

isIntransitive

public boolean isIntransitive()
Checks if this structure is intransitive

Returns:
true if both arguemnts are initialized, else false

equals

public boolean equals(java.lang.Object o)
Compares this argument structure with another.

Overrides:
equals in class java.lang.Object
Parameters:
as - the argument structure to compare against
Returns:
true if they have the same arguments, false if not.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getArg1

public java.lang.String getArg1()
Getter for this structure's first argument

Returns:
arg1 the first argument

getArg2

public java.lang.String getArg2()
Getter for this structure's second argument

Returns:
arg2 the first argument

setArg1

public void setArg1(java.lang.String arg)
Setter for this structure's first argument

Parameters:
arg - the String to set arg1 to

setArg2

public void setArg2(java.lang.String arg)
Setter for this structure's second argument

Parameters:
arg - the String to set arg2 to

resetArgumentfromAVPair

public boolean resetArgumentfromAVPair(AVPair avp)
Attempts replacing the arguments of this structure from an AVPair. Succeeds if the current value of either argument equals the attribute of the AVPair and results in replacement by its value. For example if this structure has arg1 "take" and arg2 "tile-1" and the AVPair "tile-1:tile-2" will reset arg2 to "tile-2".

Parameters:
avp - the AVPair to reset from
Returns:
true if successful, false if not

toString

public java.lang.String toString()
Builds a string representation of this arguemnt structure.

Overrides:
toString in class java.lang.Object
Returns:
the string rep