org.eigenbase.rel
Class RelCollationImpl

java.lang.Object
  extended by org.eigenbase.rel.RelCollationImpl
All Implemented Interfaces:
RelCollation

public class RelCollationImpl
extends Object
implements RelCollation

Simple implementation of RelCollation.

Since:
March 6, 2006
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/RelCollationImpl.java#6 $
Author:
jhyde

Field Summary
private  List<RelFieldCollation> fieldCollations
           
static List<RelCollation> Singleton0
          An ordering by the zeroth column.
 
Constructor Summary
RelCollationImpl(List<RelFieldCollation> fieldCollations)
           
 
Method Summary
static List<RelCollation> createSingleton(int fieldIndex)
          Creates a list containing one collation containing one field.
static boolean equal(List<RelCollation> collationList1, List<RelCollation> collationList2)
           
 boolean equals(Object obj)
           
 List<RelFieldCollation> getFieldCollations()
          Returns the ordinals and directions of the columns in this ordering.
 int hashCode()
           
static boolean isValid(RelDataType rowType, List<RelCollation> collationList, boolean fail)
          Checks that a collection of collations is valid.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Singleton0

public static final List<RelCollation> Singleton0
An ordering by the zeroth column.


fieldCollations

private final List<RelFieldCollation> fieldCollations
Constructor Detail

RelCollationImpl

public RelCollationImpl(List<RelFieldCollation> fieldCollations)
Method Detail

getFieldCollations

public List<RelFieldCollation> getFieldCollations()
Description copied from interface: RelCollation
Returns the ordinals and directions of the columns in this ordering.

Specified by:
getFieldCollations in interface RelCollation

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

toString

public String toString()
Overrides:
toString in class Object

createSingleton

public static List<RelCollation> createSingleton(int fieldIndex)
Creates a list containing one collation containing one field.


isValid

public static boolean isValid(RelDataType rowType,
                              List<RelCollation> collationList,
                              boolean fail)
Checks that a collection of collations is valid.

Parameters:
rowType - Row type of the relational expression
collationList - List of collations
fail - Whether to fail if invalid
Returns:
Whether valid

equal

public static boolean equal(List<RelCollation> collationList1,
                            List<RelCollation> collationList2)