Class Color

  • All Implemented Interfaces:
    java.io.Serializable

    @Immutable
    public abstract class Color
    extends java.lang.Object
    implements java.io.Serializable
    A simplified version of a Closure or TS type for use by optimizations
    See Also:
    Serialized Form
    • Constructor Detail

      • Color

        public Color()
    • Method Detail

      • union

        public abstract com.google.common.collect.ImmutableCollection<Color> union()
      • isPrimitive

        public final boolean isPrimitive()
        Whether this corresponds to a single JavaScript primitive like number or symbol or to a union of such primitives

        Note that the boxed versions of primitives (String, Number, etc.) are /not/ considered "primitive" by this method.

      • isClosureAssert

        public final boolean isClosureAssert()
        Whether this type is some Closure assertion function removable by Closure-specific optimizations.
      • isUnion

        public final boolean isUnion()
      • isInvalidating

        public final boolean isInvalidating()
      • propertiesKeepOriginalName

        public final boolean propertiesKeepOriginalName()
      • is

        public final boolean is​(NativeColorId color)
        Whether this is exactly the given native color (and not a union containing that color
      • isConstructor

        public final boolean isConstructor()
        Whether this is a constructor (a type that TypeScript or Closure allows calling with 'new'

        For unions, returns true if and only if all alternates in the union are constructors

      • getOwnProperties

        public com.google.common.collect.ImmutableSet<java.lang.String> getOwnProperties()
      • mayHaveProperty

        public boolean mayHaveProperty​(java.lang.String propertyName)
        Returns true if the color or any of its ancestors has the given property

        If this is a union, returns true if /any/ union alternate has the property.

        TODO(b/177695515): delete this method

      • getId

        public final com.google.common.collect.ImmutableSet<java.lang.String> getId()
      • getDebugInfo

        public final com.google.common.collect.ImmutableSet<DebugInfo> getDebugInfo()
      • getPrototype

        public final com.google.common.collect.ImmutableSet<Color> getPrototype()
      • getInstanceColor

        public final com.google.common.collect.ImmutableSet<Color> getInstanceColor()
      • getDisambiguationSupertypes

        public final com.google.common.collect.ImmutableList<Color> getDisambiguationSupertypes()
      • getNativeColorIds

        public final com.google.common.collect.ImmutableSet<NativeColorId> getNativeColorIds()
      • createUnion

        public static Color createUnion​(com.google.common.collect.ImmutableSet<Color> alternates)
      • subtractNullOrVoid

        public final Color subtractNullOrVoid()