Class Constant

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected byte tag
      Deprecated.
      (since 6.0) will be made private; do not access directly, use getter/setter
    • Field Detail

      • tag

        @Deprecated
        protected byte tag
        Deprecated.
        (since 6.0) will be made private; do not access directly, use getter/setter
    • Method Detail

      • accept

        public abstract void accept​(Visitor v)
        Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
        Specified by:
        accept in interface Node
        Parameters:
        v - Visitor object
      • dump

        public abstract void dump​(java.io.DataOutputStream file)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getTag

        public final byte getTag()
        Returns:
        Tag of constant, i.e., its type. No setTag() method to avoid confusion.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation.
      • copy

        public Constant copy()
        Returns:
        deep copy of this constant
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • readConstant

        public static Constant readConstant​(java.io.DataInput dataInput)
                                     throws java.io.IOException,
                                            ClassFormatException
        Reads one constant from the given input, the type depends on a tag byte.
        Parameters:
        dataInput - Input stream
        Returns:
        Constant object
        Throws:
        java.io.IOException - if an I/O error occurs reading from the given dataInput.
        ClassFormatException - if the next byte is not recognized
        Since:
        6.0 made public
      • getComparator

        public static BCELComparator getComparator()
        Returns:
        Comparison strategy object
      • setComparator

        public static void setComparator​(BCELComparator comparator)
        Parameters:
        comparator - Comparison strategy object
      • equals

        public boolean equals​(java.lang.Object obj)
        Returns value as defined by given BCELComparator strategy. By default two Constant objects are said to be equal when the result of toString() is equal.
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Returns value as defined by given BCELComparator strategy. By default return the hashcode of the result of toString().
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()