Package EDU.purdue.cs.bloat.file
Class Attribute
- java.lang.Object
-
- EDU.purdue.cs.bloat.file.Attribute
-
- Direct Known Subclasses:
Code,ConstantValue,Exceptions,GenericAttribute,LineNumberTable,LocalVariableTable
public abstract class Attribute extends java.lang.ObjectAttribute is an abstract class for an attribute defined for a method, field, or class. An attribute consists of its name (represented as an index into the constant pool) and its length. Attribute is extended to represent a constant value, code, exceptions, etc.- See Also:
Code,ConstantValue,Exceptions
-
-
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.Objectclone()intlength()Returns the length of the attribute, excluding the header.intnameIndex()Returns the index into the constant pool of the name of the attribute.java.lang.StringtoString()Returns a string representation of the attribute.abstract voidwriteData(java.io.DataOutputStream out)Write the attribute to a data stream.
-
-
-
Method Detail
-
writeData
public abstract void writeData(java.io.DataOutputStream out) throws java.io.IOExceptionWrite 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:
toStringin classjava.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:
clonein classjava.lang.Object
-
-