com.topcoder.shared.problem
Interface Element

All Superinterfaces:
java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable, java.io.Serializable
All Known Implementing Classes:
com.topcoder.shared.problem.BaseElement, Constraint, DataType, DataValue, NodeElement, Problem, ProblemComponent, Range, TestCase, TextElement, Value, WebService

public interface Element
extends java.io.Serializable, java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable

The Element class is an abstraction of the notion of a problem statement 'element'. An element is an entity that has the following properties:

Author:
Logan Hanks

Method Summary
 void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
          Custom serialization
 void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
          Custom serialization
 ElementRenderer getRenderer()
          Gets the renderer for the element.
 void setRenderer(ElementRenderer renderer)
          Sets the renderer for the element.
 java.lang.String toXML()
          An Element must be cable of transforming the information it represents into well-formed, valid XML (validated against the problem statement schema).
 

Method Detail

customWriteObject

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

Specified by:
customWriteObject in interface com.topcoder.shared.netCommon.CustomSerializable
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 com.topcoder.shared.netCommon.CustomSerializable
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()
An Element must be cable of transforming the information it represents into well-formed, valid XML (validated against the problem statement schema).

Returns:
A fragment of XML.

setRenderer

public void setRenderer(ElementRenderer renderer)
Sets the renderer for the element.

Parameters:
renderer - the element's renderer.
See Also:
ElementRenderer

getRenderer

public ElementRenderer getRenderer()
Gets the renderer for the element.

Returns:
the renderer for the element.
See Also:
ElementRenderer