|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectme.edwards.des.demo.Counter
public class Counter
Handles tabulation of a BlockChain into result data. The
count method
will walk the longest branch
in the specified BlockChain and generate its results in a
compact, easy to read form.
Created on: Dec 30, 2015 at 9:28:35 AM
Nested Class Summary | |
---|---|
static class |
Counter.Result
Data structure representing one section of result data: The election vote ID (e.g. |
Constructor Summary | |
---|---|
Counter()
|
Method Summary | |
---|---|
static java.util.ArrayList<Counter.Result> |
count(BlockChain bc)
Tabulates the results from the longest branch in the specified BlockChain. |
static java.lang.String |
toString(java.util.ArrayList<Counter.Result> results)
Formats a list of results into a human-readable String. |
static java.util.ArrayList<Counter.Result> |
trim(java.util.ArrayList<Counter.Result> toTrim)
Trims the specified list of results to include only the winners (or the ties) of each respective election ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Counter()
Method Detail |
---|
public static java.util.ArrayList<Counter.Result> count(BlockChain bc)
bc
- BlockChain from which to tabulate the results
Results
public static java.util.ArrayList<Counter.Result> trim(java.util.ArrayList<Counter.Result> toTrim)
toTrim
- The results to trim
public static java.lang.String toString(java.util.ArrayList<Counter.Result> results)
results
- List of results to format
trim(ArrayList)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |