T
- Member traitclass RelCompositeTrait<T extends RelMultipleTrait> extends java.lang.Object implements RelTrait
It exists so that multiple traits of the same type
(RelTraitDef
) can be stored in the same
RelTraitSet
.
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 |
---|---|
boolean |
equals(java.lang.Object obj)
|
RelTraitDef |
getTraitDef()
Returns the RelTraitDef that defines this RelTrait.
|
int |
hashCode()
|
(package private) static <T extends RelMultipleTrait> |
of(RelTraitDef def,
java.util.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()
Returns the number of traits.
|
java.lang.String |
toString()
Returns a succinct name for this trait.
|
T |
trait(int i)
Returns the
i th trait. |
java.util.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> RelTrait of(RelTraitDef def, java.util.List<T> traitList)
public RelTraitDef getTraitDef()
RelTrait
getTraitDef
in interface RelTrait
public int hashCode()
RelTrait
public boolean equals(java.lang.Object obj)
RelTrait
public java.lang.String toString()
RelTrait
public boolean satisfies(RelTrait trait)
RelTrait
A 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)
RelTrait
This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
public java.util.List<T> traitList()
public T trait(int i)
i
th trait.public int size()
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.