net.sf.saffron.core
Class SaffronTypeFactoryImpl.TypeImpl

java.lang.Object
  |
  +--net.sf.saffron.core.SaffronTypeFactoryImpl.TypeImpl
All Implemented Interfaces:
SaffronType
Direct Known Subclasses:
OJTypeFactoryImpl.OJScalarType, SaffronTypeFactoryImpl.CrossType, SaffronTypeFactoryImpl.JavaType, SaffronTypeFactoryImpl.RecordType
Enclosing class:
SaffronTypeFactoryImpl

protected abstract class SaffronTypeFactoryImpl.TypeImpl
extends Object
implements SaffronType

Abstract implementation for SaffronType. Useful if the type contains a set of fields.

Identity is based upon the digest field, which each derived class should set during construction.


Field Summary
protected  String digest
           
protected  SaffronField[] fields
           
 
Constructor Summary
protected SaffronTypeFactoryImpl.TypeImpl(SaffronField[] fields)
           
 
Method Summary
protected abstract  String computeDigest()
           
 boolean equals(Object obj)
           
 boolean equalsSansNullability(SaffronType type)
          Whether this type is identical to another, save for differences in nullability.
 void format(Object value, PrintWriter pw)
          Prints a value of this type.
 SaffronType getArrayType()
          Returns an array type with this type as the component.
 SaffronType getComponentType()
          Returns the component type if type is a collection, otherwise null.
 SaffronTypeFactory getFactory()
           
 SaffronField getField(String fieldName)
           
 int getFieldCount()
          Returns the number of columns.
 int getFieldOrdinal(String fieldName)
           
 SaffronField[] getFields()
          Returns the columns.
 SaffronType[] getJoinTypes()
          Returns the component types of a join type.
 int hashCode()
           
 boolean isJoin()
          Whether the type represents a cartesian product of regular types.
 boolean isProject()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fields

protected final SaffronField[] fields

digest

protected String digest
Constructor Detail

SaffronTypeFactoryImpl.TypeImpl

protected SaffronTypeFactoryImpl.TypeImpl(SaffronField[] fields)
Method Detail

getFactory

public SaffronTypeFactory getFactory()
Specified by:
getFactory in interface SaffronType

getField

public SaffronField getField(String fieldName)
Specified by:
getField in interface SaffronType

getFieldCount

public int getFieldCount()
Description copied from interface: SaffronType
Returns the number of columns.

Specified by:
getFieldCount in interface SaffronType

getFieldOrdinal

public int getFieldOrdinal(String fieldName)
Specified by:
getFieldOrdinal in interface SaffronType

getFields

public SaffronField[] getFields()
Description copied from interface: SaffronType
Returns the columns.

Specified by:
getFields in interface SaffronType

getComponentType

public SaffronType getComponentType()
Description copied from interface: SaffronType
Returns the component type if type is a collection, otherwise null.

Specified by:
getComponentType in interface SaffronType

getArrayType

public SaffronType getArrayType()
Description copied from interface: SaffronType
Returns an array type with this type as the component.

Specified by:
getArrayType in interface SaffronType

isJoin

public boolean isJoin()
Description copied from interface: SaffronType
Whether the type represents a cartesian product of regular types.

Specified by:
isJoin in interface SaffronType

getJoinTypes

public SaffronType[] getJoinTypes()
Description copied from interface: SaffronType
Returns the component types of a join type.

Specified by:
getJoinTypes in interface SaffronType

isProject

public boolean isProject()
Specified by:
isProject in interface SaffronType

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

computeDigest

protected abstract String computeDigest()

equalsSansNullability

public boolean equalsSansNullability(SaffronType type)
Description copied from interface: SaffronType
Whether this type is identical to another, save for differences in nullability.

Specified by:
equalsSansNullability in interface SaffronType

format

public void format(Object value,
                   PrintWriter pw)
Description copied from interface: SaffronType
Prints a value of this type.

Specified by:
format in interface SaffronType

SourceForge.net_Logo