Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class DE.fub.inf.JVM.JavaClass.Attribute

java.lang.Object
  |
  +--DE.fub.inf.JVM.JavaClass.Attribute
Subclasses:
Code, ConstantValue, Deprecated, ExceptionTable, InnerClasses, LineNumberTable, LocalVariableTable, PMGClass, SourceFile, Synthetic, Unknown

public abstract class Attribute
extends java.lang.Object
implements Constants, java.lang.Cloneable
Abstract super class for Attribute objects. Currently the ConstantValue, SourceFile, Code, Exceptiontable, LineNumberTable, LocalVariableTable, InnerClasses and Synthetic attributes are supported. The Unknown attribute stands for non-standard-attributes.

Version:
$Id: Attribute.java,v 1.1 1998/07/01 13:08:12 dahm Exp $
Author:
M. Dahm
See Also:
ConstantValue, SourceFile, Code, Unknown, ExceptionTable, LineNumberTable, LocalVariableTable, InnerClasses, Synthetic, Deprecated

Field Summary
ConstantPool constant_pool
           
int length
           
int name_index
           
byte tag
           
 
Method Summary
void accept(Visitor v)
          Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
java.lang.Object clone()
          Use copy() if you want to have a deep copy(), i.e. with all references copied correctly.
Attribute copy(ConstantPool constant_pool)
           
void dump(java.io.DataOutputStream file)
          Dump attribute to file stream in binary format.
ConstantPool getConstantPool()
           
int getLength()
           
int getNameIndex()
           
byte getTag()
           
void setConstantPool(ConstantPool constant_pool)
           
void setLength(int length)
           
void setNameIndex(int name_index)
           
java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

name_index

protected int name_index

length

protected int length

tag

protected byte tag

constant_pool

protected ConstantPool constant_pool
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.
Parameters:
v - Visitor object

dump

public void dump(java.io.DataOutputStream file)
         throws java.io.IOException
Dump attribute to file stream in binary format.
Parameters:
file - Output file stream

getLength

public final int getLength()
Returns:
Length of attribute field in bytes.

setLength

public final void setLength(int length)
Parameters:
Attribute - length in bytes.

setNameIndex

public final void setNameIndex(int name_index)
Parameters:
name_index - of attribute.

getNameIndex

public final int getNameIndex()
Returns:
Name index in constant pool of attribute name.

getTag

public final byte getTag()
Returns:
Tag of attribute, i.e. its type. Value may not be altered, thus there is no setTag() method.

getConstantPool

public final ConstantPool getConstantPool()
Returns:
Constant pool used by this object.
See Also:
ConstantPool

setConstantPool

public final void setConstantPool(ConstantPool constant_pool)
Parameters:
constant_pool - Constant pool to be used for this object.
See Also:
ConstantPool

clone

public java.lang.Object clone()
Use copy() if you want to have a deep copy(), i.e. with all references copied correctly.
Returns:
shallow copy of this attribute
Overrides:
clone in class java.lang.Object

copy

public abstract Attribute copy(ConstantPool constant_pool)
Returns:
deep copy of this attribute

toString

public java.lang.String toString()
Returns:
attribute name.
Overrides:
toString in class java.lang.Object

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD