edu.sdsc.inca.depot.persistent
Class ArgSignature

java.lang.Object
  extended by edu.sdsc.inca.depot.persistent.PersistentObject
      extended by edu.sdsc.inca.depot.persistent.ArgSignature

public class ArgSignature
extends PersistentObject

An ArgSignature consists of a set of arguments, alphabetized and combined into a string.


Field Summary
 
Fields inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
DB_EMPTY_STRING, logger, MAX_DB_LONG_STRING_LENGTH, MAX_DB_STRING_LENGTH
 
Constructor Summary
ArgSignature()
          Default constructor.
ArgSignature(java.util.Set args)
          Full constructor.
 
Method Summary
 void addArg(Arg arg)
          Add the argument to the set and invalidate the current signature.
 boolean equals(java.lang.Object o)
          Compares another object to this ArgSignature for logical equality.
 ArgSignature fromBean(edu.sdsc.inca.dataModel.util.Args a)
          Copies information from an Inca schema XmlBean Args object so that this object contains equivalent information.
 PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
          Copies information from an Inca schema XmlBean Args object so that this object contains equivalent information.
 java.util.Set getArgs()
          Retrieve the arguments involved in creating this signature.
 java.lang.Long getId()
          Retrieve the id -- null if not yet connected to database.
 java.lang.String getSignature()
          retrieve the signature.
 int hashCode()
          Calculate a hash code using the same fields that where used in equals.
 void setArgs(java.util.Set args)
          For internal use.
 void setId(java.lang.Long id)
          Set the id.
 void setSignature(java.lang.String signature)
          Set the Signature to this previously-computed signature.
 org.apache.xmlbeans.XmlObject toBean()
          Returns a Inca schema XmlBean Args object that contains information equivalent to this object.
 java.lang.String toString()
          Override of the default toString method.
 
Methods inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
toXml, truncate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArgSignature

public ArgSignature()
Default constructor.


ArgSignature

public ArgSignature(java.util.Set args)
Full constructor.

Method Detail

fromBean

public PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
Copies information from an Inca schema XmlBean Args object so that this object contains equivalent information.

Specified by:
fromBean in class PersistentObject
Parameters:
o - the XmlBean Args object to copy
Returns:
this, for convenience

fromBean

public ArgSignature fromBean(edu.sdsc.inca.dataModel.util.Args a)
Copies information from an Inca schema XmlBean Args object so that this object contains equivalent information.

Parameters:
a - the XmlBean Args object to copy
Returns:
this, for convenience

getId

public java.lang.Long getId()
Retrieve the id -- null if not yet connected to database.

Returns:
The Long representation of the DB ID

setId

public void setId(java.lang.Long id)
Set the id. Hibernate use only.

Parameters:
id - The DB ID.

getArgs

public java.util.Set getArgs()
Retrieve the arguments involved in creating this signature.

Returns:
A set of args that this Signature represents.

setArgs

public void setArgs(java.util.Set args)
For internal use.

Parameters:
args - The set of args represented by this signature.

addArg

public void addArg(Arg arg)
Add the argument to the set and invalidate the current signature.

Parameters:
arg -

getSignature

public java.lang.String getSignature()
retrieve the signature.

Returns:
the String representation of the Signature.

setSignature

public void setSignature(java.lang.String signature)
Set the Signature to this previously-computed signature.

Parameters:
signature - The string representation of the signature.

toBean

public org.apache.xmlbeans.XmlObject toBean()
Returns a Inca schema XmlBean Args object that contains information equivalent to this object.

Specified by:
toBean in class PersistentObject
Returns:
an XmlBean Args object that contains equivalent information

toString

public java.lang.String toString()
Override of the default toString method.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Compares another object to this ArgSignature for logical equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare
Returns:
true iff the comparison object represents the same ArgSignature

hashCode

public int hashCode()
Calculate a hash code using the same fields that where used in equals.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this object