choiceitem.java

来自「一个较好的java开发实例」· Java 代码 · 共 81 行

JAVA
81
字号
/* * ChoiceItem.java * * Created on 2003年11月5日, 下午9:13 */package romulus;/** * * @author  Romulus * @version 1.0 */public class ChoiceItem implements RomulusNode{        /** The ident of the choice item.*/    private String ident = null;        /** The content of the choice item.*/    private Content cont = null;        /** The label of the choice item.*/    private String label = null;        /** true if the item is the correct choice item.*/    private boolean is_corr = false;        /** Creates a new instance of ChoiceItem */    ChoiceItem(String ident, String label, boolean is_corr) throws RomulusException{        if(ident == null){            throw new RomulusException(RomulusException.IdentError);        }        this.ident = ident;        this.label = label;        this.is_corr = is_corr;    }        void setContent(Content c){        this.cont = c;    }        /**Getter*/    public String getIdent(){        return this.ident;    }        public String getLabel(){        return this.label;    }        public Content getContent(){        return this.cont;    }        public boolean isCorrect(){        return is_corr;    }        void setCorrect(boolean c){        this.is_corr = c;    }        /** for choice to do the check use containsAll.*/    public boolean equals(Object obj){        if(!(obj instanceof ChoiceItem)){            return false;        }        else if(((ChoiceItem)obj).ident == this.ident){            return true;        }        return false;    }        /** The method used to accept the Visitor to do something. */    public void Accept(Visitor v) throws java.sql.SQLException, RomulusException {        v.VisitChoiceItem(this);    }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?