ajax.type
Class FieldType

java.lang.Object
  |
  +--ajax.type.FieldType

public class FieldType
extends java.lang.Object

class FieldType - the type of a field in a tuple


Field Summary
protected  Type _elementType
          field type. this is the type of the corresponding field.
protected  java.util.HashMap backTables
          a HashMap containing the names of the tables for which this attribute is actually a backtracking explaining attribute and also the correspoding attribute.
protected  java.lang.String name
          field name
 
Constructor Summary
FieldType()
          Empty Constructor required.
FieldType(java.lang.String name, Type _type)
          Constructor
FieldType(java.lang.String name, Type _type, java.util.HashMap originTableAttribute)
          Constructor
 
Method Summary
 boolean equals(FieldType other)
          Report if this field has the same name and type as the other field
 boolean equals(java.lang.Object other)
          Report if this field has the same name and type as the other field
 Type getElementType()
          Get type of field.
 java.lang.String getExplainingAttribute(java.lang.String tableName)
          Returns the explaining attribute in the explaining table given as parameter, corresponding to this attribute
 java.util.Iterator getExplainingTables()
          Returns an Iterator through the list of the explaining tables
 java.lang.String getName()
          Get field name
 boolean isExplainingAttribute()
          Returns true if this fieldType corresponds to an attribute which is actually an explaining attribute for other tables
 boolean sameName(FieldType other)
          sameName checks if this field has the same name as the other field
 void setExplainingTable(java.util.HashMap originTableAttribute)
          Adds a table name and the corresponding attribute to the HashMap containing the explaining tables for this attribute
 java.lang.String toString()
          Convert field type to human-readable string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
field name

_elementType

protected Type _elementType
field type. this is the type of the corresponding field.

backTables

protected java.util.HashMap backTables
a HashMap containing the names of the tables for which this attribute is actually a backtracking explaining attribute and also the correspoding attribute. This is required for the implementation of the explainer module.
Constructor Detail

FieldType

public FieldType()
Empty Constructor required.

FieldType

public FieldType(java.lang.String name,
                 Type _type)
Constructor
Parameters:
name - field name
type - field type

FieldType

public FieldType(java.lang.String name,
                 Type _type,
                 java.util.HashMap originTableAttribute)
Constructor
Parameters:
name - field name
type - field type
originTable - the origin table name for explaining
Method Detail

getName

public java.lang.String getName()
Get field name
Returns:
field name

getElementType

public Type getElementType()
Get type of field. Note we do not call getBaseType.
Returns:
type of field

toString

public java.lang.String toString()
Convert field type to human-readable string.
Overrides:
toString in class java.lang.Object

sameName

public boolean sameName(FieldType other)
sameName checks if this field has the same name as the other field
Parameters:
other - the other field
Returns:
true if this field have the same name as the other field

equals

public boolean equals(FieldType other)
Report if this field has the same name and type as the other field
Parameters:
other - the other field
Returns:
true if two fields are the equal, false otherwise

equals

public boolean equals(java.lang.Object other)
Report if this field has the same name and type as the other field
Overrides:
equals in class java.lang.Object
Parameters:
other - the other field
Returns:
true if two fields are the equal, false otherwise

setExplainingTable

public void setExplainingTable(java.util.HashMap originTableAttribute)
Adds a table name and the corresponding attribute to the HashMap containing the explaining tables for this attribute
Parameters:
tableName - a String representing the name of the explaininig table
attributeName - a String representing the corresponding attribute in the explaining table

getExplainingTables

public java.util.Iterator getExplainingTables()
Returns an Iterator through the list of the explaining tables
Returns:
the table names String list Iterator

getExplainingAttribute

public java.lang.String getExplainingAttribute(java.lang.String tableName)
Returns the explaining attribute in the explaining table given as parameter, corresponding to this attribute
Returns:
the table names String list Iterator

isExplainingAttribute

public boolean isExplainingAttribute()
Returns true if this fieldType corresponds to an attribute which is actually an explaining attribute for other tables