Class Attribute

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int length  
      protected int nameIndex  
    • Constructor Summary

      Constructors 
      Constructor Description
      Attribute​(int nameIndex, int length)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      int length()
      Returns the length of the attribute, excluding the header.
      int nameIndex()
      Returns the index into the constant pool of the name of the attribute.
      java.lang.String toString()
      Returns a string representation of the attribute.
      abstract void writeData​(java.io.DataOutputStream out)
      Write the attribute to a data stream.
      • Methods inherited from class java.lang.Object

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

      • nameIndex

        protected int nameIndex
      • length

        protected int length
    • Constructor Detail

      • Attribute

        public Attribute​(int nameIndex,
                         int length)
        Constructor.
        Parameters:
        nameIndex - The index into the constant pool of the name of the attribute.
        length - The length of the attribute, excluding the header.
    • Method Detail

      • writeData

        public abstract void writeData​(java.io.DataOutputStream out)
                                throws java.io.IOException
        Write the attribute to a data stream.
        Parameters:
        out - The data stream of the class file.
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Returns a string representation of the attribute.
        Overrides:
        toString in class java.lang.Object
      • nameIndex

        public int nameIndex()
        Returns the index into the constant pool of the name of the attribute.
      • length

        public int length()
        Returns the length of the attribute, excluding the header.
      • clone

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