本文发表在 rolia.net 枫下论坛// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: Item.java
public class Item
implements Comparable
{
public Item(String s, int i, double d)
{
name = s.toLowerCase();
quantity = i;
cost = d;
}
public String getName()
{
return name;
}
public int getQuantity()
{
return quantity;
}
public double getPrice()
{
return cost;
}
public void changeQuantity(int i)
{
quantity += i;
}
public String toString()
{
return name;
}
public int compareTo(Object obj)
{
if(obj == null)
{
return 0x7fffffff;
} else
{
Item item = (Item)obj;
return name.compareTo(item.name);
}
}
protected String name;
protected int quantity;
protected double cost;
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: Item.java
public class Item
implements Comparable
{
public Item(String s, int i, double d)
{
name = s.toLowerCase();
quantity = i;
cost = d;
}
public String getName()
{
return name;
}
public int getQuantity()
{
return quantity;
}
public double getPrice()
{
return cost;
}
public void changeQuantity(int i)
{
quantity += i;
}
public String toString()
{
return name;
}
public int compareTo(Object obj)
{
if(obj == null)
{
return 0x7fffffff;
} else
{
Item item = (Item)obj;
return name.compareTo(item.name);
}
}
protected String name;
protected int quantity;
protected double cost;
}更多精彩文章及讨论,请光临枫下论坛 rolia.net