|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.topcoder.shared.problem.BaseElement
|
+--com.topcoder.shared.problem.DataType
A DataType represents a data type in a language-independent
manner. This class has all the semantics of an Element.
Element,
BaseElement,
Serialized Form| Constructor Summary | |
DataType()
This is the default constructor, available for serialization. |
|
DataType(int id,
java.lang.String description)
A DataType consists of a numeric id
a description, and a mapping between language ids and
language-specific descriptors. |
|
DataType(int id,
java.lang.String description,
java.util.HashMap typeMapping)
A DataType consists of a numeric id
a description, and a mapping between language ids and
language-specific descriptors. |
|
DataType(java.lang.String description)
A DataType consists of a numeric id
a description, and a mapping between language ids and
language-specific descriptors. |
|
| Method Summary | |
void |
customReadObject(com.topcoder.shared.netCommon.CSReader reader)
Custom serialization |
void |
customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
Custom serialization |
static java.lang.String |
encodeHTML(java.lang.String text)
Utility function for encoding HTML entities in text. |
boolean |
equals(java.lang.Object o)
Returns true if o is a DataType with the same description
as this. |
java.lang.String |
getBaseName()
The base name of a data type is the type of elements it ultimately contains (regardless of dimensionality). |
java.lang.String |
getDescription()
Returns the description of the datatype |
java.lang.String |
getDescriptor(int id)
The getDescriptor method generates a type descriptor
for this data type that is appropriate for the given language. |
java.lang.String |
getDescriptor(Language language)
The getDescriptor method generates a type descriptor
for this data type that is appropriate for the given language. |
int |
getDimension()
The dimensionality of a data type refers to how many dimensions the type has. |
int |
getID()
Returns the unique identifier for the datatype |
ElementRenderer |
getRenderer()
Returns this elements renderer. |
java.util.HashMap |
getTypeMapping()
Get's the type mappings for the data type |
DataType |
reduceDimension()
Constructs and returns a new type, similar to this type, but with its dimension reduced. |
void |
setRenderer(ElementRenderer renderer)
Sets the renderer for this element. |
void |
setTypeMapping(java.util.HashMap typeMapping)
Sets the type mapping for the data type |
java.lang.String |
toXML()
Returns the datatype described in XML |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.topcoder.shared.problem.Element |
getRenderer, setRenderer |
| Constructor Detail |
public DataType()
public DataType(java.lang.String description)
DataType consists of a numeric id
a description, and a mapping between language ids and
language-specific descriptors.
description - For example, "String[]" (pulled
from data_type.data_type_desc)
public DataType(int id,
java.lang.String description)
DataType consists of a numeric id
a description, and a mapping between language ids and
language-specific descriptors.
id - A unique integer identifier (pulled from
data_type.data_type_id)description - For example, "String[]" (pulled
from data_type.data_type_desc)
public DataType(int id,
java.lang.String description,
java.util.HashMap typeMapping)
DataType consists of a numeric id
a description, and a mapping between language ids and
language-specific descriptors.
id - A unique integer identifier (pulled from
data_type.data_type_id)description - For example, "String[]" (pulled
from data_type.data_type_desc)typeMapping - A HashMap containing all of the
language->descriptor mappings that are
defined for this data type. Each mapping
is from Integer to String,
and should be populated with information obtained from the
data_type_mapping table.| Method Detail |
public void setTypeMapping(java.util.HashMap typeMapping)
typeMapping - A HashMap containing all of the
language->descriptor mappings that are
defined for this data type. Each mapping
is from Integer to String,
and should be populated with information obtained from the
data_type_mapping table.public java.util.HashMap getTypeMapping()
public void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
throws java.io.IOException
customWriteObject in interface Elementwriter - the writer to write to.
java.io.IOException - if an I/O error has occurred in the stream that backs the writer.
public void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
throws java.io.IOException,
java.io.ObjectStreamException
customReadObject in interface Elementreader - the reader to read from.
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.public java.lang.String getDescription()
public java.lang.String getDescriptor(Language language)
getDescriptor method generates a type descriptor
for this data type that is appropriate for the given language.
language - The language in which to present the type
descriptor.
null.Languagepublic java.lang.String getDescriptor(int id)
getDescriptor method generates a type descriptor
for this data type that is appropriate for the given language.
id - The language identifier in which to present the type
descriptor.
null.Languagepublic java.lang.String getBaseName()
String[][]
is String.
public int getDimension()
String[][] is 2.
public DataType reduceDimension()
throws InvalidTypeException
DataType with the same base type as this one, but with a dimension of
one less.
InvalidTypeException - if the dimension of this type is 0public java.lang.String toXML()
toXML in interface Elementpublic boolean equals(java.lang.Object o)
o is a DataType with the same description
as this.
equals in class java.lang.Objectpublic int getID()
public void setRenderer(ElementRenderer renderer)
setRenderer in interface Elementrenderer - the element renderer.ElementRendererpublic ElementRenderer getRenderer()
getRenderer in interface ElementElementRendererpublic static java.lang.String encodeHTML(java.lang.String text)
text - the text to encode.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||