org.eigenbase.sql.type
Class SqlTypeAssignmentRules

java.lang.Object
  extended by org.eigenbase.sql.type.SqlTypeAssignmentRules

public class SqlTypeAssignmentRules
extends Object

Class to hold rules to determine if a type is assignable from another type.

REVIEW 7/05/04 Wael: We should split this up in Cast rules, symmetric and asymmetric assignable rules

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/type/SqlTypeAssignmentRules.java#20 $
Author:
Wael Chatila

Field Summary
private static Map<SqlTypeName,Set<SqlTypeName>> coerceRules
           
private static SqlTypeAssignmentRules instance
           
private static Map<SqlTypeName,Set<SqlTypeName>> rules
           
 
Constructor Summary
private SqlTypeAssignmentRules()
           
 
Method Summary
 boolean canCastFrom(SqlTypeName to, SqlTypeName from, boolean coerce)
           
private static
<K,V> HashMap<K,V>
copy(Map<K,V> map)
           
private static
<T> HashSet<T>
copy(Set<T> set)
           
static SqlTypeAssignmentRules instance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static SqlTypeAssignmentRules instance

rules

private static Map<SqlTypeName,Set<SqlTypeName>> rules

coerceRules

private static Map<SqlTypeName,Set<SqlTypeName>> coerceRules
Constructor Detail

SqlTypeAssignmentRules

private SqlTypeAssignmentRules()
Method Detail

instance

public static SqlTypeAssignmentRules instance()

canCastFrom

public boolean canCastFrom(SqlTypeName to,
                           SqlTypeName from,
                           boolean coerce)

copy

private static <K,V> HashMap<K,V> copy(Map<K,V> map)

copy

private static <T> HashSet<T> copy(Set<T> set)