package kamicharserver;

public class KamiCommand {
    
    int nID;
    Object[] aFields;
    
    
    //
    // Constructor
    public KamiCommand() {
        nID = -1;
        aFields = new Object[32];
    }
    
    public void setID(int i) {
        nID = i;
    }
    public int getID() {
        return nID;
    }
    
    public void set(int i, Object o) {
        aFields[i] = o;
    }
    public Object get(int i) {
        return aFields[i];
    }
    
    
    // =========================================================================
    // Misc.
    //
    public void clear() {
        byte i = 0;
        while(i<aFields.length) {
            aFields[i] = null;
            ++i;
        }
    }
    
    public String toString() {
        String s = ""+getID()+"[";
        byte i = 0;
        while(i<aFields.length) {
	    if(aFields[i]==null) return s+"]";
            s+=aFields[i]+",";
            ++i;
        }
        return s+"]";
    }
    
    
}
