easik.sketch.datatype
Class DataTypeController

java.lang.Object
  extended by easik.sketch.datatype.DataTypeController

public class DataTypeController
extends java.lang.Object

Class to controll data type information. Supplies relevant datatypes and information depending on user defined data type group.

Version:
2006-08-23 Kevin Green
Author:
Kevin Green 2006, Vera Ranieri 2006

Field Summary
private  java.util.ArrayList<DataType> _dataTypes
          The data types defined for this data type controller
private  boolean _useDB2
          Stores whether DB2 types are active
private  boolean _useMySQL
          Stores whether MySQL types are active
private  boolean _useOracle
          Stores whether Oracle types are active
private  boolean _useUserDefined
          Stores whether User Defined types are active
private  boolean _useXML
          Stores whether XML types are active
 
Constructor Summary
DataTypeController()
          Default Constructor
 
Method Summary
 void addDataType(DataType inType)
          Adds a new data type entry to the _dataTypes ArrayList
 DataType addNewDataType()
          Adds a new data type entry to the _dataTypes ArrayList, and returns it
 java.util.ArrayList getActiveTypes()
          Gets a list of all types currently defined by the user.
 java.util.ArrayList getDataTypes()
          Returns an ArrayList of the current data types available for the data type platform used by the sketch
 boolean is_useDB2()
           
 boolean is_useMySQL()
           
 boolean is_useOracle()
           
 boolean is_useUserDefined()
           
 boolean is_useXML()
           
 boolean isNameFree(DataType inType, java.lang.String newName)
          Checks to see if the data type name is used by any other data type other then itself
 void loadNullsFromDefaults(java.lang.String type)
          Searches through data types for types named the same as standard types and loads up the standard value into the null position.
 void removeDataType(DataType inType, DataType inReplacement)
          Removes the data type from the array.
 void resetDataTypes()
          Resets the data type array to the standard types
 void set_useDB2(boolean _usedb2)
           
 void set_useMySQL(boolean mySQL)
           
 void set_useOracle(boolean oracle)
           
 void set_useUserDefined(boolean userDefined)
           
 void set_useXML(boolean _usexml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dataTypes

private java.util.ArrayList<DataType> _dataTypes
The data types defined for this data type controller


_useMySQL

private boolean _useMySQL
Stores whether MySQL types are active


_useOracle

private boolean _useOracle
Stores whether Oracle types are active


_useDB2

private boolean _useDB2
Stores whether DB2 types are active


_useXML

private boolean _useXML
Stores whether XML types are active


_useUserDefined

private boolean _useUserDefined
Stores whether User Defined types are active

Constructor Detail

DataTypeController

public DataTypeController()
Default Constructor

Method Detail

getDataTypes

public java.util.ArrayList getDataTypes()
Returns an ArrayList of the current data types available for the data type platform used by the sketch

Returns:
ArrayList of the current data types available for the data type platform used by the sketch

loadNullsFromDefaults

public void loadNullsFromDefaults(java.lang.String type)
Searches through data types for types named the same as standard types and loads up the standard value into the null position. If no name match is found then it loads the default value into the null position.

Parameters:
type - The platform that is being loaded from nulls (If no specified from given platforms then only null values are reloaded)

resetDataTypes

public void resetDataTypes()
Resets the data type array to the standard types


addNewDataType

public DataType addNewDataType()
Adds a new data type entry to the _dataTypes ArrayList, and returns it

Returns:
the new DataType added to the list of datatypes of this controller

addDataType

public void addDataType(DataType inType)
Adds a new data type entry to the _dataTypes ArrayList

Parameters:
inType - The data type to be added.

removeDataType

public void removeDataType(DataType inType,
                           DataType inReplacement)
Removes the data type from the array. Replaces all references of the removed data type with the replacement data type.

Parameters:
inType - The data type to be removed.
inReplacement - The data type to be used as the replacement

isNameFree

public boolean isNameFree(DataType inType,
                          java.lang.String newName)
Checks to see if the data type name is used by any other data type other then itself

Parameters:
inType - The type to compare
newName - The desired new name of the type
Returns:
True if the new name is free, false otherwise.

is_useDB2

public boolean is_useDB2()
Returns:
Returns the _useDB2.

set_useDB2

public void set_useDB2(boolean _usedb2)
Parameters:
_usedb2 - The _useDB2 to set.

is_useMySQL

public boolean is_useMySQL()
Returns:
Returns the _useMySQL.

set_useMySQL

public void set_useMySQL(boolean mySQL)
Parameters:
mySQL - The _useMySQL to set.

is_useOracle

public boolean is_useOracle()
Returns:
Returns the _useOracle.

set_useOracle

public void set_useOracle(boolean oracle)
Parameters:
oracle - The _useOracle to set.

is_useUserDefined

public boolean is_useUserDefined()
Returns:
Returns the _useUserDefined.

set_useUserDefined

public void set_useUserDefined(boolean userDefined)
Parameters:
userDefined - The _useUserDefined to set.

is_useXML

public boolean is_useXML()
Returns:
Returns the _useXML.

set_useXML

public void set_useXML(boolean _usexml)
Parameters:
_usexml - The _useXML to set.

getActiveTypes

public java.util.ArrayList getActiveTypes()
Gets a list of all types currently defined by the user.

Returns:
An arraylist containing the names of defined types.
Since:
2006-06-27 Vera Ranieri