KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > types > reflect > Attribute


1 package polyglot.types.reflect;
2
3 import java.util.*;
4 import java.io.*;
5
6 /**
7  * Attribute is an abstract class for an attribute defined for a method,
8  * field, or class. An attribute consists of its name (represented as an
9  * index into the constant pool) and its length. Attribute is extended
10  * to represent a constant value, code, exceptions, etc.
11  *
12  * @see polyglot.types.reflect ConstantValue
13  * @see polyglot.types.reflect Exceptions
14  *
15  * @author Nate Nystrom
16  * (<a HREF="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu</a>)
17  */

18 abstract class Attribute {
19   protected int nameIndex;
20   protected int length;
21
22   /**
23    * Constructor.
24    *
25    * @param nameIndex
26    * The index into the constant pool of the name of the attribute.
27    * @param length
28    * The length of the attribute, excluding the header.
29    */

30   Attribute(int nameIndex, int length) {
31     this.nameIndex = nameIndex;
32     this.length = length;
33   }
34 }
35
Popular Tags