Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

Weight.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: Weight.java,v 12.2 2005/06/16 20:22:32 bostic Exp $
00008  */
00009 
00010 package collections.ship.factory;
00011 
00012 import java.io.Serializable;
00013 
00022 public class Weight implements Serializable {
00023 
00024     public final static String GRAMS = "grams";
00025     public final static String OUNCES = "ounces";
00026 
00027     private double amount;
00028     private String units;
00029 
00030     public Weight(double amount, String units) {
00031 
00032         this.amount = amount;
00033         this.units = units;
00034     }
00035 
00036     public final double getAmount() {
00037 
00038         return amount;
00039     }
00040 
00041     public final String getUnits() {
00042 
00043         return units;
00044     }
00045 
00046     public String toString() {
00047 
00048         return "[" + amount + ' ' + units + ']';
00049     }
00050 }

Generated on Sun Dec 25 12:14:27 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2