gr.uoa.di.madgik.execution.datatype
Class DataTypeArray

java.lang.Object
  extended by gr.uoa.di.madgik.execution.datatype.DataTypeArray
All Implemented Interfaces:
IDataType, Iterable<IDataType>

public class DataTypeArray
extends Object
implements IDataType, Iterable<IDataType>

This class represents a data type that acts as an array of data types


Nested Class Summary
 
Nested classes/interfaces inherited from interface gr.uoa.di.madgik.execution.datatype.IDataType
IDataType.DataTypes
 
Constructor Summary
DataTypeArray()
           
 
Method Summary
 boolean CanSuggestDataTypeClass()
          Always returns false
 void FromXML(Element XML)
          Parses the xml serialization of the data type as retrieved by IDataType.ToXML()
 void FromXML(String XML)
          Parses the xml serialization of the data type as retrieved by IDataType.ToXML()
 String GetArrayClassCode()
          Gets the array code.
 Class<?> GetDataTypeClass()
          Returns null
 IDataType.DataTypes GetDataTypeEnum()
          Returns IDataType.DataTypes.Array
 String GetDefaultComponentType()
          Gets the default component type.
 String GetDefaultConverter()
          Gets the default converter.
 IDataType[] GetItems()
          Gets the array items.
 String GetStringValue()
          Calls ToXML()
 Object GetValue()
          if the contained array data types is null, then null is returned.
 Iterator<IDataType> iterator()
           
 void SetArrayClassCode(String ArrayClassCode)
          Sets the array code.
 void SetDefaultComponentType(String DefaultComponentType)
          Sets the default component type.
 void SetDefaultConverter(String DefaultConverter)
          Sets the default converter.
 void SetStringValue(String val)
          Calls FromXML(String)
 void SetValue(Object Value)
          if the provided value is null, then the internal array is set to null.
 String ToXML()
          Creates an xml serialization of the data type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeArray

public DataTypeArray()
Method Detail

iterator

public Iterator<IDataType> iterator()
Specified by:
iterator in interface Iterable<IDataType>

GetArrayClassCode

public String GetArrayClassCode()
Gets the array code.

Returns:
the array code

SetArrayClassCode

public void SetArrayClassCode(String ArrayClassCode)
Sets the array code.

Parameters:
ArrayClassCode - the array code

GetDefaultConverter

public String GetDefaultConverter()
Gets the default converter.

Returns:
the string

SetDefaultConverter

public void SetDefaultConverter(String DefaultConverter)
Sets the default converter.

Parameters:
DefaultConverter - the default converter

GetDefaultComponentType

public String GetDefaultComponentType()
Gets the default component type.

Returns:
the string

SetDefaultComponentType

public void SetDefaultComponentType(String DefaultComponentType)
Sets the default component type.

Parameters:
DefaultComponentType - the default component type

CanSuggestDataTypeClass

public boolean CanSuggestDataTypeClass()
Always returns false

Specified by:
CanSuggestDataTypeClass in interface IDataType
Returns:
true, if it can
See Also:
IDataType.CanSuggestDataTypeClass()

GetDataTypeClass

public Class<?> GetDataTypeClass()
Returns null

Specified by:
GetDataTypeClass in interface IDataType
Returns:
the run time type
See Also:
IDataType.GetDataTypeClass()

GetDataTypeEnum

public IDataType.DataTypes GetDataTypeEnum()
Returns IDataType.DataTypes.Array

Specified by:
GetDataTypeEnum in interface IDataType
Returns:
the data type
See Also:
IDataType.GetDataTypeEnum()

GetStringValue

public String GetStringValue()
                      throws ExecutionSerializationException
Calls ToXML()

Specified by:
GetStringValue in interface IDataType
Returns:
the string representation of the value
Throws:
ExecutionSerializationException - A serialization error occurred
See Also:
IDataType.GetStringValue()

SetStringValue

public void SetStringValue(String val)
                    throws ExecutionValidationException,
                           ExecutionSerializationException
Calls FromXML(String)

Specified by:
SetStringValue in interface IDataType
Parameters:
val - the value to set
Throws:
ExecutionValidationException - A validation error occurred
ExecutionSerializationException - A serialization error occurred
See Also:
IDataType.SetStringValue(java.lang.String)

GetItems

public IDataType[] GetItems()
Gets the array items.

Returns:
the contained data types

GetValue

public Object GetValue()
if the contained array data types is null, then null is returned. Otherwise, an array is created with as many dimensions as are dictated by the array code and in every index of the array the respective IDataType.GetValue() is set.

Specified by:
GetValue in interface IDataType
Returns:
the value
See Also:
IDataType.GetValue()

SetValue

public void SetValue(Object Value)
              throws ExecutionValidationException
if the provided value is null, then the internal array is set to null. Otherwise, if the value is an instance of an array of IDataType, then the internal array is set to that. If the value is a string, the FromXML(String) is called. Otherwise, if the provided value is an array, a new array of the type that is dictated by the array code is created and the respective data types are created from the respective values of the argument.

Specified by:
SetValue in interface IDataType
Parameters:
Value - the value to set
Throws:
ExecutionValidationException - A validation error occurred
See Also:
IDataType.SetValue(java.lang.Object)

FromXML

public void FromXML(String XML)
             throws ExecutionSerializationException
Description copied from interface: IDataType
Parses the xml serialization of the data type as retrieved by IDataType.ToXML()

Specified by:
FromXML in interface IDataType
Parameters:
XML - the XML serialization
Throws:
ExecutionSerializationException - A serialization error occurred

FromXML

public void FromXML(Element XML)
             throws ExecutionSerializationException
Description copied from interface: IDataType
Parses the xml serialization of the data type as retrieved by IDataType.ToXML()

Specified by:
FromXML in interface IDataType
Parameters:
XML - The root element of the serialization
Throws:
ExecutionSerializationException - A validation error occurred

ToXML

public String ToXML()
             throws ExecutionSerializationException
Description copied from interface: IDataType
Creates an xml serialization of the data type

Specified by:
ToXML in interface IDataType
Returns:
the XML serialization
Throws:
ExecutionSerializationException - a serialization error occurred


Copyright © 2012. All Rights Reserved.