@Override public int size() { int result = 0; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { result += archives[i].resourceInstSize; } return result; } }
@Override public int size() { int result = 0; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { result += archives[i].resourceInstSize; } return result; } }
@Override public Object get(int idx) { int archiveIdx = 0; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (idx < (archiveIdx + f.resourceInstSize)) { return f.resourceInstTable[idx - archiveIdx]; } archiveIdx += f.resourceInstSize; } return null; } @Override
@Override public Object get(int idx) { int archiveIdx = 0; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (idx < (archiveIdx + f.resourceInstSize)) { return f.resourceInstTable[idx - archiveIdx]; } archiveIdx += f.resourceInstSize; } return null; } @Override
private void dump(PrintWriter stream) { StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; f.dump(stream); } }
private int getMemoryUsed() { int result = 0; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; result += f.getMemoryUsed(); } return result; }
private void dump(PrintWriter stream) { StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; f.dump(stream); } }
private int getMemoryUsed() { int result = 0; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; result += f.getMemoryUsed(); } return result; }
/** * Closes all archives. */ public void close() throws IOException { if (!this.closed) { StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; f.close(); } this.closed = true; } }
/** * Closes all archives. */ public void close() throws IOException { if (!this.closed) { StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; f.close(); } this.closed = true; } }
private boolean update(boolean doReset, boolean autoClose) throws IOException { if (this.closed) { return false; } boolean result = false; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (f.update(doReset)) { result = true; } if (autoClose) { f.close(); } } return result; }
private boolean update(boolean doReset, boolean autoClose) throws IOException { if (this.closed) { return false; } boolean result = false; StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (f.update(doReset)) { result = true; } if (autoClose) { f.close(); } } return result; }
/** * Returns an array of stat values that match the specified spec. * If nothing matches then an empty array is returned. */ public StatValue[] matchSpec(StatSpec spec) { if (spec.getCombineType() == StatSpec.GLOBAL) { StatValue[] allValues = matchSpec(new RawStatSpec(spec)); if (allValues.length == 0) { return allValues; } else { ComboValue cv = new ComboValue(allValues); // need to save this in reader's combo value list return new StatValue[]{cv}; } } else { List l = new ArrayList(); StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (spec.archiveMatches(f.getFile())) { f.matchSpec(spec, l); } } StatValue[] result = new StatValue[l.size()]; return (StatValue[])l.toArray(result); } }
StatArchiveReader.StatArchiveFile[] archives = reader.getArchives(); for (int i=0; i < archives.length; i++) { System.out.println(archives[i].getArchiveInfo().toString());
/** * Returns an array of stat values that match the specified spec. * If nothing matches then an empty array is returned. */ public StatValue[] matchSpec(StatSpec spec) { if (spec.getCombineType() == StatSpec.GLOBAL) { StatValue[] allValues = matchSpec(new RawStatSpec(spec)); if (allValues.length == 0) { return allValues; } else { ComboValue cv = new ComboValue(allValues); // need to save this in reader's combo value list return new StatValue[]{cv}; } } else { List l = new ArrayList(); StatArchiveReader.StatArchiveFile[] archives = getArchives(); for (int i=0; i < archives.length; i++) { StatArchiveFile f = archives[i]; if (spec.archiveMatches(f.getFile())) { f.matchSpec(spec, l); } } StatValue[] result = new StatValue[l.size()]; return (StatValue[])l.toArray(result); } }
StatArchiveReader.StatArchiveFile[] archives = reader.getArchives(); for (int i=0; i < archives.length; i++) { System.out.println(archives[i].getArchiveInfo().toString());