《JSP信息系统开发实例精选》一书中的雄霸天下游戏网站的源代码
源代码在线查看: cart.java
package com.bwm.cart;
import java.util.Vector;
import java.util.Enumeration;
public class cart{
Vector vector=new Vector();
String submit=null;
String item=null;
private void additem(String itemName){
vector.addElement(itemName);
}
private void removeitem(String itemName){
vector.removeElement(itemName);
}
public void setItem(String item){
this.item=item;
}
public String[] getItems(){
String[] sa=new String[vector.size()];
vector.copyInto(sa);
return sa;
}
public void setSubmit(String submit){
this.submit=submit;
}
public String getSubmit(){
return submit;
}
private void initialize(){
submit="add";
item=null;
}
}