|
|
|
@ -10,16 +10,32 @@ public class ProposalTally implements ProposalTallyInterface {
|
|
|
|
|
// Should we allow this as well?
|
|
|
|
|
//public ProposalTally() {}
|
|
|
|
|
|
|
|
|
|
public ProposalTally(String[] tally) {
|
|
|
|
|
setTally(tally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProposalTally(Integer[] tally) {
|
|
|
|
|
setTally(tally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProposalTally(Long[] tally) {
|
|
|
|
|
setTally(tally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProposalTally(BigInteger[] tally) {
|
|
|
|
|
setTally(tally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTally(String[] tally) {
|
|
|
|
|
int tallyLength = tally.length;
|
|
|
|
|
BigInteger[] bigTally = new BigInteger[tallyLength];
|
|
|
|
|
for (int i = 0 ; i < tallyLength ; i++) {
|
|
|
|
|
bigTally[i] = BigInteger.valueOf(tally[i]);
|
|
|
|
|
bigTally[i] = new BigInteger(tally[i]);
|
|
|
|
|
}
|
|
|
|
|
setTally(bigTally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProposalTally(Long[] tally) {
|
|
|
|
|
public void setTally(Integer[] tally) {
|
|
|
|
|
int tallyLength = tally.length;
|
|
|
|
|
BigInteger[] bigTally = new BigInteger[tallyLength];
|
|
|
|
|
for (int i = 0 ; i < tallyLength ; i++) {
|
|
|
|
@ -28,8 +44,13 @@ public class ProposalTally implements ProposalTallyInterface {
|
|
|
|
|
setTally(bigTally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProposalTally(BigInteger[] tally) {
|
|
|
|
|
setTally(tally);
|
|
|
|
|
public void setTally(Long[] tally) {
|
|
|
|
|
int tallyLength = tally.length;
|
|
|
|
|
BigInteger[] bigTally = new BigInteger[tallyLength];
|
|
|
|
|
for (int i = 0 ; i < tallyLength ; i++) {
|
|
|
|
|
bigTally[i] = BigInteger.valueOf(tally[i]);
|
|
|
|
|
}
|
|
|
|
|
setTally(bigTally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTally(BigInteger[] tally) {
|
|
|
|
@ -48,7 +69,6 @@ public class ProposalTally implements ProposalTallyInterface {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void moveJudgments(Integer fromGrade, Integer intoGrade) {
|
|
|
|
|
// this.tally[intoGrade] += this.tally[fromGrade];
|
|
|
|
|
this.tally[intoGrade] = this.tally[intoGrade].add(this.tally[fromGrade]);
|
|
|
|
|
this.tally[fromGrade] = BigInteger.ZERO;
|
|
|
|
|
}
|
|
|
|
|