ref_send API 2.17
defensive programming in Java

org.ref_send.brand
Class Amount<T>

java.lang.Object
  extended by org.ref_send.brand.Amount<T>
Type Parameters:
T - unit type
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Amount<T>>, Immutable, Powerless, Selfless, Record

public class Amount<T>
extends java.lang.Object
implements java.lang.Comparable<Amount<T>>, Powerless, Record, java.io.Serializable

A typed long value.

See Also:
Serialized Form

Field Summary
 Brand<T> unit
          unit of value
 long value
          number of units
 
Constructor Summary
Amount(Brand<T> unit, long value)
          Constructs an instance.
 
Method Summary
 int compareTo(Amount<T> o)
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unit

public final Brand<T> unit
unit of value


value

public final long value
number of units

Constructor Detail

Amount

public Amount(Brand<T> unit,
              long value)
Constructs an instance.

Parameters:
unit - unit
value - value
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Selfless
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(Amount<T> o)
              throws WrongBrand
Specified by:
compareTo in interface java.lang.Comparable<Amount<T>>
Throws:
WrongBrand

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.