com.topcoder.shared.problem
Class SizeConstraint

java.lang.Object
  |
  +--com.topcoder.shared.problem.BaseElement
        |
        +--com.topcoder.shared.problem.Constraint
              |
              +--com.topcoder.shared.problem.SizeConstraint
All Implemented Interfaces:
java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable, Element, java.io.Serializable
Direct Known Subclasses:
MaxSizeConstraint, MinSizeConstraint

public abstract class SizeConstraint
extends Constraint

The SizeConstraint class is for constraints related to the size (length) of a parameter. The SizeConstraint hold information as to which dimension the size refers to, the name of the parameter, and what the size is. This class is not currently being used but is reserved for future use.

Author:
mitalub
See Also:
MaxSizeConstraint, MinSizeConstraint, Serialized Form

Field Summary
protected  int dimension
          The dimension the size applies to.
protected  java.lang.String paramName
          The parameter name.
protected  int size
          The size.
 
Constructor Summary
SizeConstraint()
          Empty constructor required by custom serialization.
SizeConstraint(int size, int dimension, java.lang.String paramName)
          Constructs the Size constraint from the given parms.
 
Method Summary
 void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
          Custom serializiation
 void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
          Custom serializiation
 int getDimension()
          Return the dimension the size applies to.
 java.lang.String getParamName()
          Returns the parameter name.
 int getSize()
          Return the size.
 
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, toXML
 

Field Detail

size

protected int size
The size.


dimension

protected int dimension
The dimension the size applies to.


paramName

protected java.lang.String paramName
The parameter name.

Constructor Detail

SizeConstraint

public SizeConstraint(int size,
                      int dimension,
                      java.lang.String paramName)
Constructs the Size constraint from the given parms.

Parameters:
size - the size.
dimension - the dimension the size applies to.
paramName - the parameter name.

SizeConstraint

public SizeConstraint()
Empty constructor required by custom serialization.

Method Detail

getSize

public int getSize()
Return the size.

Returns:
the size.

getDimension

public int getDimension()
Return the dimension the size applies to.

Returns:
the dimension the size applies to.

getParamName

public java.lang.String getParamName()
Returns the parameter name.

Returns:
the parameter name.

customWriteObject

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

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 serializiation

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.