DEADSOFTWARE

Remove batch
[gpcp-linux.git] / J2CPS / MemberInfo.java
1 /**********************************************************************/
2 /* Member Info class for J2CPS */
3 /* */
4 /* (c) copyright QUT */
5 /**********************************************************************/
6 package J2CPS;
8 import java.io.DataInputStream;
9 import java.io.IOException;
11 public class MemberInfo {
13 public ClassDesc owner;
14 public int accessFlags;
15 public String name;
16 public String signature;
18 public MemberInfo(ConstantPool cp,DataInputStream stream,ClassDesc own)
19 throws IOException {
20 owner = own;
21 accessFlags = stream.readUnsignedShort();
22 name = (String) cp.Get(stream.readUnsignedShort());
23 signature = (String) cp.Get(stream.readUnsignedShort());
24 /* skip the attributes */
25 int attrCount = stream.readUnsignedShort();
26 for (int i = 0; i < attrCount; i++) {
27 int attNameIx = stream.readUnsignedShort();
28 if ("ConstantValue".equals((String)cp.Get(attNameIx)) &&
29 (this instanceof FieldInfo)) {
30 ((FieldInfo)this).GetConstValueAttribute(cp,stream);
31 } else {
32 if ("Deprecated".equals((String)cp.Get(attNameIx)) &&
33 (this instanceof MethodInfo)) { ((MethodInfo)this).deprecated = true; }
34 int attrLength = stream.readInt();
35 for (int j = 0; j < attrLength; j++) {
36 int tmp = stream.readByte();
37 }
38 }
39 }
40 }
42 public MemberInfo(ClassDesc own,int acc,String nam) {
43 owner = own;
44 accessFlags = acc;
45 name = nam;
46 }
48 public boolean isPublicStatic() {
49 return ConstantPool.isStatic(accessFlags) &&
50 ConstantPool.isPublic(accessFlags);
51 }
53 public boolean isExported() {
54 return (ConstantPool.isPublic(accessFlags) ||
55 ConstantPool.isProtected(accessFlags));
56 }
58 public boolean isPublic() {
59 return ConstantPool.isPublic(accessFlags);
60 }
62 public boolean isStatic() {
63 return ConstantPool.isStatic(accessFlags);
64 }
66 public boolean isPrivate() {
67 return ConstantPool.isPrivate(accessFlags);
68 }
70 public boolean isProtected() {
71 return ConstantPool.isProtected(accessFlags);
72 }
74 public boolean isAbstract() {
75 return ConstantPool.isAbstract(accessFlags);
76 }
78 public boolean isFinal() {
79 return ConstantPool.isFinal(accessFlags);
80 }
82 @Override
83 public String toString() { return ""; };
86 }