public <TEntry extends Entry<?>> TEntry createEntry(Class<TEntry> type, String folder) { if (StringEntry.class.equals(type)) { return type.cast(new StringEntry(folder)); } else if (IntegerEntry.class.equals(type)) { return type.cast(new IntegerEntry(folder)); } throw new IllegalArgumentException("Unknown type: " + type); }
/** * Adds a CONSTANT_String_info to the const pool. */ public Integer addStringEntry(String string) { if (stringLocations.containsKey(string)) { return stringLocations.get(string); } final Integer utf8Location = addUtf8Entry(string); final Integer index = count++; constPoolSize++; entries.put(index, new StringEntry(utf8Location)); stringLocations.put(string, index); return index; }
/** * Adds a CONSTANT_String_info to the const pool. */ public short addStringEntry(String string) { if (stringLocations.containsKey(string)) { return stringLocations.get(string); } final short utf8Location = addUtf8Entry(string); final short index = count++; constPoolSize++; entries.put(index, new StringEntry(utf8Location)); stringLocations.put(string, index); return index; }
/** * Adds a CONSTANT_String_info to the const pool. */ public Integer addStringEntry(String string) { if (stringLocations.containsKey(string)) { return stringLocations.get(string); } final Integer utf8Location = addUtf8Entry(string); final Integer index = count++; constPoolSize++; entries.put(index, new StringEntry(utf8Location)); stringLocations.put(string, index); return index; }
/** * Adds a CONSTANT_String_info to the const pool. */ public Integer addStringEntry(String string) { if (stringLocations.containsKey(string)) { return stringLocations.get(string); } final Integer utf8Location = addUtf8Entry(string); final Integer index = count++; constPoolSize++; entries.put(index, new StringEntry(utf8Location)); stringLocations.put(string, index); return index; }
/** * Adds a CONSTANT_String_info to the const pool. */ public Integer addStringEntry(String string) { if (stringLocations.containsKey(string)) { return stringLocations.get(string); } final Integer utf8Location = addUtf8Entry(string); final Integer index = count++; constPoolSize++; entries.put(index, new StringEntry(utf8Location)); stringLocations.put(string, index); return index; }
public <T, TEntry extends Entry<T>> List<TEntry> createEntries(Class<TEntry> type) throws ZipException { List<TEntry> entries = new ArrayList<TEntry>(); List<String> paths = new ArrayList<String>();//getPaths(type); for (String path : paths) { entries.add(createEntry(type, path)); } return entries; } public <T, TEntry extends Entry<T>> TEntry createEntry(Class<TEntry> type, String folder) { if (StringEntry.class.equals(type)) { return type.cast(new StringEntry(folder)); } else if (IntegerEntry.class.equals(type)) { return type.cast(new IntegerEntry(folder)); } throw new IllegalArgumentException("Unknown type: " + type); } }