public interface TraitContainer
Modifier and Type | Interface and Description |
---|---|
static class |
TraitContainer.TraitHashMap
The actual, mutable implementation used to aggregate traits.
|
Modifier and Type | Field and Description |
---|---|
static TraitContainer |
EMPTY
Shared empty, immutable instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> |
getTraitsAppliedToPrelude()
Gets all traits applied to the prelude.
|
java.util.Map<ShapeId,Trait> |
getTraitsForShape(ShapeId shape)
Gets the traits applied to a shape.
|
void |
onTrait(ShapeId target,
ShapeId traitId,
Node value)
Create and add a trait.
|
void |
onTrait(ShapeId target,
Trait value)
Add a trait.
|
java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> |
traits() |
static final TraitContainer EMPTY
java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> traits()
java.util.Map<ShapeId,Trait> getTraitsForShape(ShapeId shape)
shape
- Shape to get the traits of.java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> getTraitsAppliedToPrelude()
void onTrait(ShapeId target, Trait value)
target
- Shape to add the trait to.value
- Trait to add.