Class DataType

    • Constructor Summary

      Constructors 
      Constructor Description
      DataType​(TypeSystem typeSystem, java.lang.String name, java.lang.String description, java.util.List<TypeVar> typeVars, java.util.SortedMap<java.lang.String,​Type> typeConstructors)
      Creates a DataType.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <R> R accept​(TypeVisitor<R> typeVisitor)  
      (package private) static java.lang.String computeDescription​(java.util.Map<java.lang.String,​Type> tyCons)  
      Type copy​(TypeSystem typeSystem, java.util.function.Function<Type,​Type> transform)
      Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
      private com.google.common.collect.ImmutableSortedMap<java.lang.String,​Type> copyTypes​(TypeSystem typeSystem, java.util.SortedMap<java.lang.String,​Type> typeConstructors, java.util.function.Function<Type,​Type> transform)  
      java.lang.String name()
      Name of the type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        public final java.lang.String name
      • typeVars

        public final java.util.List<TypeVar> typeVars
      • typeConstructors

        public final java.util.SortedMap<java.lang.String,​Type> typeConstructors
    • Constructor Detail

      • DataType

        DataType​(TypeSystem typeSystem,
                 java.lang.String name,
                 java.lang.String description,
                 java.util.List<TypeVar> typeVars,
                 java.util.SortedMap<java.lang.String,​Type> typeConstructors)
        Creates a DataType.

        Called only from TypeSystem.dataType(String, List, Map). If the typeSystem argument is specified, canonizes the types inside type-constructors. This also allows temporary types (necessary while creating self-referential data types) to be replaced with real DataType instances.

    • Method Detail

      • copyTypes

        private com.google.common.collect.ImmutableSortedMap<java.lang.String,​Type> copyTypes​(@Nonnull
                                                                                                    TypeSystem typeSystem,
                                                                                                    @Nonnull
                                                                                                    java.util.SortedMap<java.lang.String,​Type> typeConstructors,
                                                                                                    @Nonnull
                                                                                                    java.util.function.Function<Type,​Type> transform)
      • copy

        public Type copy​(TypeSystem typeSystem,
                         java.util.function.Function<Type,​Type> transform)
        Description copied from interface: Type
        Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
        Specified by:
        copy in interface Type
      • name

        public java.lang.String name()
        Description copied from interface: NamedType
        Name of the type.
        Specified by:
        name in interface NamedType
      • computeDescription

        static java.lang.String computeDescription​(java.util.Map<java.lang.String,​Type> tyCons)