Class Colors

    • Constructor Detail

      • Colors

        public Colors()
        Creates a new, initially empty, set of colors.
      • Colors

        public Colors​(Colors colors)
        Creates a new set of colors initialized to a copy of the given one.
        Parameters:
        colors - the set of colors to copy.
    • Method Detail

      • setName

        public void setName​(ElementKind key,
                            String color)
                     throws IllegalArgumentException
        Sets the color of the given syntactic element from a color name. The color names supported in the current implementation are "red", "green", "yellow", "blue", "magenta", "cyan" and "gray", case-insensitive.
        Parameters:
        key - the syntactic element for which to set the color.
        color - the color to give to the specified element, or null if none.
        Throws:
        Illegal­Argument­Exception - if the given color name is not recognized.
      • getName

        public final String getName​(ElementKind key)
        Returns the color for the given syntactic element.
        Parameters:
        key - the syntactic element for which to get the color.
        Returns:
        the color of the specified element, or null if none.
      • clone

        public Colors clone()
        Returns a clone of this Colors.
        Overrides:
        clone in class Object
        Returns:
        a clone of this Colors.
      • equals

        public boolean equals​(Object other)
        Compares this Colors with the given object for equality.
        Overrides:
        equals in class Object
        Parameters:
        other - the object to compare with this Colors.
        Returns:
        true if both objects are equal.
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Overrides:
        hash­Code in class Object
        Returns:
        a hash code value.