Methods Summary |
---|
public void | addElement(ClassAttribute attr)Add an element to the vector
if (attributes == null)
attributes = new ClassAttribute[1];
else {
ClassAttribute newAttributes[] = new ClassAttribute[attributes.length+1];
System.arraycopy(attributes, 0, newAttributes, 0, attributes.length);
attributes = newAttributes;
}
attributes[attributes.length-1] = attr;
|
private ClassAttribute | attrAt(int i)Returns the i'th attribute in the array
return attributes[i];
|
public java.util.Enumeration | elements()
class AttributeVectorEnumeration implements Enumeration {
private ClassAttribute[] attributes;
private int current = 0;
AttributeVectorEnumeration(ClassAttribute attrs[]) {
attributes = attrs;
}
public boolean hasMoreElements() {
return attributes != null && current < attributes.length;
}
public Object nextElement() {
if (!hasMoreElements())
throw new NoSuchElementException();
return attributes[current++];
}
}
return new AttributeVectorEnumeration(attributes);
|
public ClassAttribute | findAttribute(java.lang.String attrName)Look for an attribute of a specific name
Enumeration e = elements();
while (e.hasMoreElements()) {
ClassAttribute attr = (ClassAttribute) e.nextElement();
if (attr.attrName().asString().equals(attrName))
return attr;
}
return null;
|
void | print(java.io.PrintStream out, int indent)Print a description of the attributes
if (attributes != null) {
for (int i=0; i<attributes.length; i++)
attributes[i].print(out, indent);
}
|
static com.sun.jdo.api.persistence.enhancer.classfile.AttributeVector | readAttributes(java.io.DataInputStream data, ConstantPool constantPool)General attribute reader
AttributeVector attribs = new AttributeVector();
int n_attrs = data.readUnsignedShort();
while (n_attrs-- > 0) {
attribs.addElement(ClassAttribute.read(data, constantPool));
}
return attribs;
|
static com.sun.jdo.api.persistence.enhancer.classfile.AttributeVector | readAttributes(java.io.DataInputStream data, CodeEnv codeEnv)ClassMethod attribute reader
AttributeVector attribs = new AttributeVector();
int n_attrs = data.readUnsignedShort();
while (n_attrs-- > 0) {
attribs.addElement(ClassAttribute.read(data, codeEnv));
}
return attribs;
|
void | summarize()Print a brief summary of the attributes
System.out.println((attributes == null ? 0 : attributes.length) +
" attributes");//NOI18N
|
void | write(java.io.DataOutputStream out)Write the attributes to the output stream
if (attributes == null) {
out.writeShort(0);
} else {
out.writeShort(attributes.length);
for (int i=0; i<attributes.length; i++)
attributes[i].write(out);
}
|