JML

org.multijava.util.classfile
Class AnnotShortElementValue

java.lang.Object
  extended byorg.multijava.util.classfile.AnnotElementValue
      extended byorg.multijava.util.classfile.AnnotShortElementValue

public class AnnotShortElementValue
extends AnnotElementValue

A class representing a short value in an element-value pair of an annotation structure.

Author:
AHS
See Also:
Annotation.ElementValuePair

Field Summary
private  IntegerConstant value
          the constant pool entry for this value
 
Constructor Summary
AnnotShortElementValue(ConstantPool cp, DataInput in)
          Construct a new element-value from a classfile stream.
AnnotShortElementValue(short value)
          Construct a new element-value with the given value.
 
Method Summary
(package private)  int getSize()
          Return the size in bytes that this value takes up in the class file (not including the tag).
(package private)  void resolveConstants(ConstantPool cp)
          Insert or check location of constant value on constant pool.
 String toString()
          Return a textual representation of the value.
 short value()
          Return the encapsulated value.
(package private)  void write(ConstantPool cp, DataOutput out)
          Write this value to a classfile stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

private IntegerConstant value
the constant pool entry for this value

Constructor Detail

AnnotShortElementValue

public AnnotShortElementValue(short value)
Construct a new element-value with the given value.


AnnotShortElementValue

public AnnotShortElementValue(ConstantPool cp,
                              DataInput in)
                       throws IOException
Construct a new element-value from a classfile stream.

Parameters:
cp - the constant pool
in - the input stream to read from
Throws:
IOException - an IO exception has occurred
Method Detail

resolveConstants

void resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool.

Parameters:
cp - the constant pool for this class

write

void write(ConstantPool cp,
           DataOutput out)
     throws IOException
Write this value to a classfile stream.

Parameters:
cp - the constant pool
out - the output stream
Throws:
IOException - an IO error has occurred

getSize

int getSize()
Return the size in bytes that this value takes up in the class file (not including the tag).


toString

public String toString()
Return a textual representation of the value.

Specified by:
toString in class AnnotElementValue

value

public short value()
Return the encapsulated value.


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.