Accumulate 1.2 build: 9172 released: 2008-01-01 Accumulate by category. Copyright (c) 2008 Canadian Mind Products. final class library. Download from http://mindprod.com/products2.html#ACCUMULATE ===> Free <=== Full source included. You may even include the source code, modified or unmodified in commercial programs that you write and distribute. May be used freely for any purpose but military. For more details on this restriction, see http://mindprod.com/roedy.html#NONMILITARY If you include any Canadian Mind Products code in your own applications, your app too must be labeled non-military use only. All Java jars and source code are included. ---- Prerequisites: This program runs under any OS, (e.g. Win2K/XP/Vista/OSX/Linux/Solaris/Vista64/AIX...) so long as you have <><> Java version 1.2 <><> or later installed. See http://mindprod.com/jgloss/installingjava.html for details. ---- Installing on a PC: Download source and compiled class files to run on your own machine as a part of your own program. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. To install, extract the zip download with Winzip (or similar unzip utility) into any directory you please, often J:\ -- ticking off the "user folder names" option. ---- Installing on a MacIntosh: Use Safari to download source and compiled class files to run on your own machine as a part of your own program. Safari will automatically unpack the zip into ~/Downloads (version 10.5) [or on the Desktop (version 10.4 and earlier)]. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. You may optionally move the download tree to a permanent home. I don't have a MacIntosh, just a PC, so I can't test the programs for Mac compatibility. In theory they should work without problems, but in practice that does not always happen. If you have problems please, let me know, preferably with screenshots and complete verbatim error messages. ---- Rebuilding: The zip already contains the necessary class and jar files, so unless you modify the program, there is no need to recompile the source or rebuild the jar. Configure basedir="E:/" in rebuild.xml to the drive where your files are. Use ANT and rebuild.xml, not build.xml, to recompile and recreate the jar. ---- Use: Used to accumulate values by category. It might be useful for example in a billing program to accumulate hours by various categories. It could be used to count how many times various words occurred in a document. All you need is: buckets.accumulate( "somecategory", someamount ); And Accumulate looks after creating the buckets to accumulate new categories for you. e.g. Accumulate buckets = new Accumulate( 20 ); buckets.accumulate( "ugli fruit", 3 ); buckets.accumulate( "peaches", 10 ); buckets.accumulate( "strawberries", 15 ); buckets.accumulate( "peaches", 14 ); String[] categories = buckets.categories(); // prints: // peaches:24 // strawberries:15 // ugli fruit:3 for ( int i=0; i