public class ComponentXMLData
extends java.lang.Object
Constructor and Description |
---|
ComponentXMLData(ComponentType ctype,
java.io.File xmlfile)
Constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAuthor()
Returns the author value defined in the source XML file.
|
java.lang.String |
getClassDir()
Returns the path of base directory of the root class as it is defined in the XML file.
|
java.lang.String |
getClassName()
Returns the root class name of this component as it is defined in the XML file.
|
java.lang.Class<? extends AbstractComponent> |
getComponentClass()
Returns the root class of this component.
|
ComponentType |
getComponentType()
Returns the type of this component.
|
java.lang.String |
getDescription()
Returns the description of this problem as it is defined in the XML file.
|
java.lang.String |
getImageLocation()
Returns the path to the reference image of this component as it is defined in the XML file.
|
java.util.ArrayList<java.lang.String> |
getKeywords()
Returns a reference to a list containing the keywords as defined in the source XML file.
|
java.lang.String |
getName()
Returns a human-readable name of this component as it is defined in the XML file.
|
AbstractMethod |
getNewMethodInstance(NESRandom random)
Returns a new method instance created from this source data.
|
AbstractRanking |
getNewRankingInstance()
Returns a new ranking instance created from this source data.
|
AbstractRepresentation |
getNewRepresentationInstance(int inputnumber,
int outputnumber,
NESRandom random)
Returns a new representation instance created from this source data.
|
java.util.Hashtable<java.lang.String,XMLFieldEntry> |
getProperties()
Returns a map containing the loaded property pairs defined in the XML file.
|
java.io.File |
getSourceXMLFile()
Returns a reference to the source XML file used to construct this component.
|
XMLFieldType |
getTypeOfProperty(java.lang.String key)
Returns the type of the given property key.
|
java.lang.String |
getValueOfProperty(java.lang.String key)
Returns the value assigned to the given property key.
|
java.lang.String |
getVersion()
Returns the version of this problem as it is defined in the XML file.
|
boolean |
isLoadedSuccessfully()
Indicates if the loading process encountered no errors.
|
java.lang.String |
toString()
Returns a
String representation of this component. |
public ComponentXMLData(ComponentType ctype, java.io.File xmlfile)
ctype
- The type of this component.xmlfile
- The XML file used to load up data into this class.public boolean isLoadedSuccessfully()
public java.util.Hashtable<java.lang.String,XMLFieldEntry> getProperties()
public ComponentType getComponentType()
public java.lang.Class<? extends AbstractComponent> getComponentClass()
public java.lang.String getClassName()
public java.lang.String getClassDir()
public java.lang.String getDescription()
public java.lang.String getAuthor()
public java.lang.String getVersion()
public java.lang.String getImageLocation()
public java.lang.String getName()
public java.io.File getSourceXMLFile()
public AbstractMethod getNewMethodInstance(NESRandom random) throws java.lang.InstantiationException
InstantiationException
if this component is not a method description.java.lang.InstantiationException
- if this component is not a method descriptorpublic AbstractRepresentation getNewRepresentationInstance(int inputnumber, int outputnumber, NESRandom random) throws java.lang.InstantiationException
InstantiationException
if this component is not a representation description.java.lang.InstantiationException
- if this component is not a representation descriptorpublic AbstractRanking getNewRankingInstance() throws java.lang.InstantiationException
InstantiationException
if this component is not a ranking description.java.lang.InstantiationException
- if this component is not a ranking descriptorpublic XMLFieldType getTypeOfProperty(java.lang.String key)
key
- The property key whose type is requested.public java.lang.String getValueOfProperty(java.lang.String key)
key
- The property key whose assigned value is requested.String
value assigned to the given property key.public java.util.ArrayList<java.lang.String> getKeywords()
public java.lang.String toString()
String
representation of this component.toString
in class java.lang.Object
String
representation of this component.