예제 #1
0
  public Integer compare(ValueStore<V> other) {
    if (other.moneySystem != moneySystem) {
      return null;
    }

    V val = moneySystem.subtract(getValue(), other.getValue());
    return (moneySystem.isValueNothing(val) ? 0 : (moneySystem.isValueDeficit(val) ? -1 : 1));
  }
예제 #2
0
 public boolean equals(ValueStore<V> other) {
   return (other.moneySystem == moneySystem
       && moneySystem.isValueNothing(moneySystem.subtract(getValue(), other.getValue())));
 }