Class TraitContainer.TraitHashMap

  • All Implemented Interfaces:
    TraitContainer
    Enclosing interface:
    TraitContainer

    public static final class TraitContainer.TraitHashMap
    extends java.lang.Object
    implements TraitContainer
    The actual, mutable implementation used to aggregate traits.
    • Method Detail

      • getTraitsForShape

        public java.util.Map<ShapeId,​Trait> getTraitsForShape​(ShapeId shape)
        Description copied from interface: TraitContainer
        Gets the traits applied to a shape.
        Specified by:
        getTraitsForShape in interface TraitContainer
        Parameters:
        shape - Shape to get the traits of.
        Returns:
        Returns the traits of the shape.
      • onTrait

        public void onTrait​(ShapeId target,
                            Trait value)
        Description copied from interface: TraitContainer
        Add a trait.
        Specified by:
        onTrait in interface TraitContainer
        Parameters:
        target - Shape to add the trait to.
        value - Trait to add.
      • onTrait

        public void onTrait​(ShapeId target,
                            ShapeId traitId,
                            Node value)
        Description copied from interface: TraitContainer
        Create and add a trait.
        Specified by:
        onTrait in interface TraitContainer
        Parameters:
        target - Shape to add the trait to.
        traitId - Trait shape ID to create.
        value - The value to assign to the trait.