pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.checkout
Class TotalPrice.Quota

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.shop.checkout.TotalPrice.Quota
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TotalPrice.Quota>
Enclosing class:
TotalPrice

@Entity(name="checkout_Quota")
public static class TotalPrice.Quota
extends AbstractBasicEntity
implements java.lang.Comparable<TotalPrice.Quota>

The Quota.

Version:
$Revision$
Author:
Christian Schatt
See Also:
Serialized Form

Constructor Summary
protected TotalPrice.Quota()
          Deprecated. 
  TotalPrice.Quota(TaxRate tr, java.math.BigDecimal a)
          Creates a new Quota from the given TaxRate and amount.
  TotalPrice.Quota(TotalPrice.Quota q)
          The copy constructor.
 
Method Summary
 TotalPrice.Quota add(TotalPrice.Quota q)
          Returns a new Quota that is the sum of this Quota and the given Quota.
 int compareTo(TotalPrice.Quota q)
          Compares this Quota with the given Quota for order.
 TotalPrice.Quota divide(java.math.BigDecimal d)
          Returns a new Quota that is the result of the division of this Quota and the given divisor.
 boolean equals(java.lang.Object o)
          Determines whether the given Object is equal to this Quota.
 java.math.BigDecimal getAmount()
          Returns the amount.
 TaxRate getTaxRate()
          Returns the TaxRate.
 int hashCode()
          Returns the hash code for this Quota.
 TotalPrice.Quota multiply(java.math.BigDecimal m)
          Returns a new Quota that is the product of this Quota and the given multiplicand.
 TotalPrice.Quota subtract(TotalPrice.Quota q)
          Returns a new Quota that is the difference of this Quota and the given Quota.
 java.lang.String toString()
          Returns the String representation of this Quota.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, getFullQualifiedClassNameJAXB, getId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TotalPrice.Quota

@Deprecated
protected TotalPrice.Quota()
Deprecated. 

The no-argument constructor used by JAXB and JPA.


TotalPrice.Quota

public TotalPrice.Quota(TotalPrice.Quota q)
The copy constructor.

Parameters:
q - the Quota to be copied.
Throws:
java.lang.IllegalArgumentException - if the given Quota is null.

TotalPrice.Quota

public TotalPrice.Quota(TaxRate tr,
                        java.math.BigDecimal a)
Creates a new Quota from the given TaxRate and amount.

Parameters:
tr - the TaxRate.
a - the amount.
Throws:
java.lang.IllegalArgumentException - if the given TaxRate or amount is null.
Method Detail

getTaxRate

public final TaxRate getTaxRate()
Returns the TaxRate.

Returns:
the TaxRate.

getAmount

public final java.math.BigDecimal getAmount()
Returns the amount.

Returns:
the amount.

add

public final TotalPrice.Quota add(TotalPrice.Quota q)
Returns a new Quota that is the sum of this Quota and the given Quota.

Parameters:
q - the Quota to be added to this Quota.
Returns:
the new Quota.
Throws:
java.lang.IllegalArgumentException - if the given Quota is null or its TaxRate is not equal to the TaxRate of this Quota.

subtract

public final TotalPrice.Quota subtract(TotalPrice.Quota q)
Returns a new Quota that is the difference of this Quota and the given Quota.

Parameters:
q - the Quota to be subtracted from this Quota.
Returns:
the new Quota.
Throws:
java.lang.IllegalArgumentException - if the given Quota is null or its TaxRate is not equal to the TaxRate of this Quota.

multiply

public final TotalPrice.Quota multiply(java.math.BigDecimal m)
Returns a new Quota that is the product of this Quota and the given multiplicand.

Parameters:
m - the multiplicand.
Returns:
the new Quota.
Throws:
java.lang.IllegalArgumentException - if the given multiplicand is null.

divide

public final TotalPrice.Quota divide(java.math.BigDecimal d)
Returns a new Quota that is the result of the division of this Quota and the given divisor.

Parameters:
d - the divisor.
Returns:
the new Quota.
Throws:
java.lang.IllegalArgumentException - if the given divisor is null.

compareTo

public int compareTo(TotalPrice.Quota q)
Compares this Quota with the given Quota for order.

Specified by:
compareTo in interface java.lang.Comparable<TotalPrice.Quota>
Parameters:
q - the Quota to be compared.
Returns:
a negative integer, zero, or a positive integer as this Quota is less than, equal to, or greater than the given Quota.
Throws:
java.lang.IllegalArgumentException - if the given Quota is null.

toString

public java.lang.String toString()
Returns the String representation of this Quota.

Overrides:
toString in class java.lang.Object
Returns:
the String representation.

equals

public boolean equals(java.lang.Object o)
Determines whether the given Object is equal to this Quota. Two Quotas are considered equal, if their TaxRates and amounts are equal.

Overrides:
equals in class AbstractBasicEntity
Parameters:
o - the Object.
Returns:
true, if the given Object is equal to this Quota.

hashCode

public int hashCode()
Returns the hash code for this Quota.

Overrides:
hashCode in class AbstractBasicEntity
Returns:
the hash code.
See Also:
AbstractBasicEntity.hashCode()