com.topcoder.shared.problem
Class UserConstraint

java.lang.Object
  |
  +--com.topcoder.shared.problem.BaseElement
        |
        +--com.topcoder.shared.problem.Constraint
              |
              +--com.topcoder.shared.problem.UserConstraint
All Implemented Interfaces:
java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable, Element, java.io.Serializable

public class UserConstraint
extends Constraint

A user constraint is where the problem writer writes arbitrary text to specify a constraint. This class is basically just a container for some Element. This class is not in use but reserved for future use.

Author:
Logan Hanks
See Also:
Element, Serialized Form

Constructor Summary
UserConstraint()
          Empty constructor required by custom serialization.
UserConstraint(Element elem)
          Constructs the constraint from another element.
UserConstraint(java.lang.String text)
          Constructs the constraint from text.
 
Method Summary
 void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
          Custom serialization
 void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
          Custom serialization
 java.lang.String getText()
          Returns the text of the constraint
 Element getUserConstraint()
          Returns the element for the constraint
 java.lang.String toXML()
          Returns the XML representation of this element.
 
Methods inherited from class com.topcoder.shared.problem.Constraint
encodeHTML, getRenderer, setRenderer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.topcoder.shared.problem.Element
getRenderer, setRenderer
 

Constructor Detail

UserConstraint

public UserConstraint()
Empty constructor required by custom serialization.


UserConstraint

public UserConstraint(java.lang.String text)
Constructs the constraint from text.

Parameters:
text - the text of the constraint.

UserConstraint

public UserConstraint(Element elem)
Constructs the constraint from another element.

Parameters:
elem - the element holding the constraint.
Method Detail

customWriteObject

public void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
                       throws java.io.IOException
Custom serialization

Specified by:
customWriteObject in interface Element
Overrides:
customWriteObject in class Constraint
Parameters:
writer - the writer to write to.
Throws:
java.io.IOException - if an I/O error has occurred in the stream that backs the writer.

customReadObject

public void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
                      throws java.io.IOException,
                             java.io.ObjectStreamException
Custom serialization

Specified by:
customReadObject in interface Element
Overrides:
customReadObject in class Constraint
Parameters:
reader - the reader to read from.
Throws:
java.io.ObjectStreamException - if the information that is read is inconsistent (stream corrupted or incompatibility between writers and readers)
java.io.IOException - if an I/O error has occurred in the stream that backs the reader.

toXML

public java.lang.String toXML()
Returns the XML representation of this element. Formatted as <user-constraint>text</user-constraint>.

Returns:
the XML representation of this element.

getUserConstraint

public Element getUserConstraint()
Returns the element for the constraint

Returns:
the element for the constraint

getText

public java.lang.String getText()
Returns the text of the constraint

Returns:
the text of the constraint