T - Member traitclass RelCompositeTrait<T extends RelMultipleTrait> extends Object implements RelTrait
It exists so that multiple traits of the same type
(RelTraitDef) can be stored in the same
RelTraitSet.
| Modifier and Type | Class and Description |
|---|---|
private static class |
RelCompositeTrait.EmptyCompositeTrait<T extends RelMultipleTrait>
Composite trait with 0 elements.
|
| Modifier and Type | Field and Description |
|---|---|
private RelTraitDef |
traitDef |
private T[] |
traits |
| Modifier | Constructor and Description |
|---|---|
private |
RelCompositeTrait(RelTraitDef traitDef,
T[] traits)
Creates a RelCompositeTrait.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) RelCompositeTrait<T> |
canonize(RelTraitDef<T> traitDef) |
boolean |
equals(Object obj)
|
RelTraitDef |
getTraitDef()
Returns the RelTraitDef that defines this RelTrait.
|
int |
hashCode()
|
(package private) static <T extends RelMultipleTrait> |
of(RelTraitDef def,
List<T> traitList)
Creates a RelCompositeTrait.
|
void |
register(RelOptPlanner planner)
Registers a trait instance with the planner.
|
boolean |
satisfies(RelTrait trait)
Returns whether this trait satisfies a given trait.
|
int |
size() |
String |
toString()
Returns a succinct name for this trait.
|
T |
trait(int i) |
List<T> |
traitList()
Returns an immutable list of the traits in this composite trait.
|
private final RelTraitDef traitDef
private final T extends RelMultipleTrait[] traits
private RelCompositeTrait(RelTraitDef traitDef, T[] traits)
static <T extends RelMultipleTrait> RelCompositeTrait<T> of(RelTraitDef def, List<T> traitList)
public RelTraitDef getTraitDef()
RelTraitgetTraitDef in interface RelTraitpublic int hashCode()
RelTraitpublic String toString()
RelTraitpublic boolean satisfies(RelTrait trait)
RelTraitA trait satisfies another if it is the same or stricter. For example,
ORDER BY x, y satisfies ORDER BY x.
A trait's satisfies relation must be a partial order (reflexive,
anti-symmetric, transitive). Many traits cannot be "loosened"; their
satisfies is an equivalence relation, where only X satisfies X.
If a trait has multiple values
(see RelCompositeTrait)
a collection (T0, T1, ...) satisfies T if any Ti satisfies T.
public void register(RelOptPlanner planner)
RelTraitThis is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
public List<T> traitList()
RelCompositeTrait<T> canonize(RelTraitDef<T> traitDef)
public T trait(int i)
public int size()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.