Mercurial > hg > blitz_condensed
diff src/org/dancres/blitz/entry/InstanceCheckpoint.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/dancres/blitz/entry/InstanceCheckpoint.java Sat Mar 21 11:00:06 2009 +0000 @@ -0,0 +1,30 @@ +package org.dancres.blitz.entry; + +import java.io.Serializable; + +import java.util.ArrayList; + +/** + If logging of instance counts is enabled, at each checkpoint, we will lodge + an instance of this class as a checkpoint contribution + */ +class InstanceCheckpoint implements Serializable { + private ArrayList theCounts = new ArrayList(); + private long theTime = System.currentTimeMillis(); + + void add(String aType, int aCount) { + theCounts.add(new CountAction(aType, aCount)); + } + + public String toString() { + StringBuffer myBuffer = new StringBuffer(); + + for (int i = 0; i < theCounts.size(); i++) { + CountAction myCount = (CountAction) theCounts.get(i); + + myBuffer.append(theTime + " :" + myCount.toString() + "\n"); + } + + return myBuffer.toString(); + } +} \ No newline at end of file