ConstInfo getItem(int n) { return items.elementAt(n); }
ConstInfo getItem(int n) { return items.elementAt(n); }
private static HashMap makeItemsCache(LongVector items) { HashMap cache = new HashMap(); int i = 1; while (true) { ConstInfo info = items.elementAt(i++); if (info == null) break; else cache.put(info, info); } return cache; }
/** * Prints the contents of the constant pool table. */ public void print(PrintWriter out) { int size = numOfItems; for (int i = 1; i < size; ++i) { out.print(i); out.print(" "); items.elementAt(i).print(out); } } }
private static Map<ConstInfo,ConstInfo> makeItemsCache(LongVector items) { Map<ConstInfo,ConstInfo> cache = new HashMap<ConstInfo,ConstInfo>(); int i = 1; while (true) { ConstInfo info = items.elementAt(i++); if (info == null) break; cache.put(info, info); } return cache; }
/** * Writes the contents of the constant pool table. */ public void write(DataOutputStream out) throws IOException { out.writeShort(numOfItems); LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) v.elementAt(i).write(out); }
/** * Replaces all occurrences of a class name. * * @param oldName the replaced name (JVM-internal representation). * @param newName the substituted name (JVM-internal representation). */ public void renameClass(String oldName, String newName) { LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) { ConstInfo ci = v.elementAt(i); ci.renameClass(this, oldName, newName, itemsCache); } }
/** * Replaces all occurrences of class names. * * @param classnames specifies pairs of replaced and substituted * name. */ public void renameClass(Map classnames) { LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) { ConstInfo ci = v.elementAt(i); ci.renameClass(this, classnames, itemsCache); } }
/** * Get all the class names. * * @return a set of class names (<code>String</code> objects). */ public Set getClassNames() { HashSet result = new HashSet(); LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) { String className = v.elementAt(i).getClassName(this); if (className != null) result.add(className); } return result; }
/** * Writes the contents of the constant pool table. */ public void write(DataOutputStream out) throws IOException { out.writeShort(numOfItems); LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) v.elementAt(i).write(out); }
/** * Prints the contents of the constant pool table. */ public void print(PrintWriter out) { int size = numOfItems; for (int i = 1; i < size; ++i) { out.print(i); out.print(" "); items.elementAt(i).print(out); } } }
/** * Replaces all occurrences of class names. * * @param classnames specifies pairs of replaced and substituted * name. */ public void renameClass(Map<String,String> classnames) { LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) { ConstInfo ci = v.elementAt(i); ci.renameClass(this, classnames, itemsCache); } }
/** * Replaces all occurrences of a class name. * * @param oldName the replaced name (JVM-internal representation). * @param newName the substituted name (JVM-internal representation). */ public void renameClass(String oldName, String newName) { LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) { ConstInfo ci = v.elementAt(i); ci.renameClass(this, oldName, newName, itemsCache); } }
/** * Get all the class names. * * @return a set of class names (<code>String</code> objects). */ public Set<String> getClassNames() { Set<String> result = new HashSet<String>(); LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) { String className = v.elementAt(i).getClassName(this); if (className != null) result.add(className); } return result; }
private static HashMap makeItemsCache(LongVector items) { HashMap cache = new HashMap(); int i = 1; while (true) { ConstInfo info = items.elementAt(i++); if (info == null) break; else cache.put(info, info); } return cache; }
/** * Writes the contents of the constant pool table. */ public void write(DataOutputStream out) throws IOException { out.writeShort(numOfItems); LongVector v = items; int size = numOfItems; for (int i = 1; i < size; ++i) v.elementAt(i).write(out); }
/** * Prints the contents of the constant pool table. */ public void print(PrintWriter out) { int size = numOfItems; for (int i = 1; i < size; ++i) { out.print(i); out.print(" "); items.elementAt(i).print(out); } } }
/** * Prints the contents of the constant pool table. */ public void print(PrintWriter out) { int size = numOfItems; for (int i = 1; i < size; ++i) { out.print(i); out.print(" "); ((ConstInfo)items.elementAt(i)).print(out); } } }
/** * Prints the contents of the constant pool table. */ public void print(PrintWriter out) { int size = numOfItems; for (int i = 1; i < size; ++i) { out.print(i); out.print(" "); items.elementAt(i).print(out); } } }
/** * Prints the contents of the constant pool table. */ public void print(PrintWriter out) { int size = numOfItems; for (int i = 1; i < size; ++i) { out.print(i); out.print(" "); items.elementAt(i).print(out); } } }