Class BaseTypeVisitor

  • All Implemented Interfaces:
    IDatatypeVisitor

    public class BaseTypeVisitor
    extends java.lang.Object
    implements IDatatypeVisitor
    A visitor which determines the (recursive) base type of a given type. In particular, the topmost base type of a derived type is determined.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • BaseTypeVisitor

        private BaseTypeVisitor()
        Prevents initialization from outside.
    • Method Detail

      • setType

        private void setType​(IDatatype type)
        Defines the initial value of the base type (also used for resetting and reuse).
        Parameters:
        type - the initial base type
      • getType

        private IDatatype getType()
        Returns the inferred base type.
        Returns:
        the base type
      • releaseInstance

        private static final void releaseInstance​(BaseTypeVisitor visitor)
        Releases an instance to the pool.
        Parameters:
        visitor - the instance to be released
      • getBaseType

        public static final IDatatype getBaseType​(IDatatype type)
        Returns the base type of type.
        Parameters:
        type - the type the base type shall be determined
        Returns:
        type or the base type
      • visitSet

        public void visitSet​(Set set)
        Description copied from interface: IDatatypeVisitor
        Is called by a set data type.
        Specified by:
        visitSet in interface IDatatypeVisitor
        Parameters:
        set - the set instance
      • visitRealType

        public void visitRealType​(RealType type)
        Description copied from interface: IDatatypeVisitor
        Visiting method for visiting a RealType.
        Specified by:
        visitRealType in interface IDatatypeVisitor
        Parameters:
        type - The IDatatype which should be visited.
      • visitCompoundType

        public void visitCompoundType​(Compound compound)
        Description copied from interface: IDatatypeVisitor
        Visiting method for visiting a Compound.
        Specified by:
        visitCompoundType in interface IDatatypeVisitor
        Parameters:
        compound - The Compound which should be visited.
      • visitEnumType

        public void visitEnumType​(Enum enumType)
        Description copied from interface: IDatatypeVisitor
        Visiting method for visiting a Enum.
        Specified by:
        visitEnumType in interface IDatatypeVisitor
        Parameters:
        enumType - The Enum which should be visited.