예제 #1
0
  /**
   * Validates a collection of anything splitable. This implies that it contains <code>
   * {@link CreditSplit}</code> instances.
   *
   * @param splitable_it
   * @param creditType
   * @param greaterCummulative
   * @return boolean is valid?
   */
  public boolean validateCreditSplitable(
      Iterator<? extends CreditSplitable> splitable_it,
      InvestigatorCreditType creditType,
      DecimalHolder greaterCummulative) {
    if (!splitable_it.hasNext()) {
      return isCreditSplitTotalValid(greaterCummulative.getValue());
    }
    boolean retval = true;

    CreditSplitable splitable = splitable_it.next();
    info(VALIDATING_MESSAGE, getCreditSplitableName(splitable));

    DecimalHolder lesserCummulative = new DecimalHolder(KualiDecimal.ZERO);
    retval &=
        validateCreditSplit(splitable.getCreditSplits().iterator(), creditType, lesserCummulative);

    greaterCummulative.add(lesserCummulative);

    return retval & validateCreditSplitable(splitable_it, creditType, greaterCummulative);
  }
예제 #2
0
 /** @see java.lang.Comparable#compareTo(java.lang.Object) */
 public int compareTo(DecimalHolder obj) {
   return value.compareTo(obj.getValue());
 }
예제 #3
0
 public void add(DecimalHolder val) {
   value = value.add(val.getValue());
 }