1 ackage jconst;
16
17 import java.io.*;
18 import util.*;
19
20 blic class constClass_or_String extends constBase {
36 int index = 0;
37 constUtf8 Utf8 = null;
38
39 void read( DataInputStream dStream ) {
40 index = readU2( dStream );
41 }
42
43 public void set_ref(constBase objAry[] ) {
46 constBase tmp = objAry[ index ];
47
48 if (tmp instanceof constUtf8) {
49 Utf8 = (constUtf8)tmp;
50 }
51 else {
52 System.out.println("Object at index " + index + " is not a constUtf8");
53 }
54 }
56 public void pr() {
57 super.pr();
58 System.out.print(": ");
59 if (Utf8 != null) {
60 Utf8.pr();
61 }
62 else {
63 System.out.println("null ref");
64 }
65 }
67 public void prString() {
68 if (Utf8 != null) {
69 String name;
70
71 name = objNameFormat.toDotSeparator( Utf8.getString() );
72 if (name != null) {
73 System.out.print( name );
74 }
75 else {
76 System.out.println("\nconstClass_or_String: prName - name is null");
77 }
78 }
79 }
80
81 public String getPrintableString() {
82 return Utf8.getPrintableString();
83 }
84
85 public String getString() {
86 return Utf8.getString();
87 }
89 }
91