question.java

来自「java案例开发一书的源代码」· Java 代码 · 共 103 行

JAVA
103
字号
/* * Question.java * * Created on 2003年11月5日, 下午9:19 */package romulus;/** * * @author  Romulus * @version 1.0 */public class Question implements RomulusNode{        /** The ident of the Question.*/    private String ident = null;        /** The timing of the Question in ms.     * 0 means no timing.     */    private long timing = 0;        /** The title of the Question.*/    private String title = null;        /** The Objectives of the Question.*/    private java.util.Vector objectives = new java.util.Vector();        /** The Feedbacks of the Question.*/    private java.util.Vector feedbacks = new java.util.Vector();        /** The Question item of the Question.*/    private QuestionItem qitem = null;        /** Creates a new instance of Question */    Question(String ident, long timing, String title) throws RomulusException{        if(ident == null){            throw new RomulusException(RomulusException.IdentError);        }        if(timing < 0){            throw new RomulusException(RomulusException.TimingError);        }        this.ident = ident;        this.timing = timing;        this.title = title;    }        /** Add and remove the objectives.*/    void addObjective(Objective obj){        objectives.add(obj);    }        boolean removeObjective(Objective obj){        return objectives.remove(obj);    }    /** Add and remove the feedback.*/    void addFeedback(Feedback fb){        feedbacks.add(fb);    }        boolean removeFeedback(Feedback fb){        return feedbacks.remove(fb);    }        /** Set the QuestionItem.*/    void setQuestionItem(QuestionItem qitem){        this.qitem = qitem;    }        /** Get the imformations. */    public String getIdent(){        return ident;    }        public long getTiming(){        return timing;    }        public String getTitle(){        return title;    }        public QuestionItem getItem(){        return qitem;    }    public java.util.Iterator objectiveIterator(){        return objectives.iterator();    }        public java.util.Iterator feedbackIterator(){        return feedbacks.iterator();    }    /** The method used to accept the Visitor to do something. */    public void Accept(Visitor v) throws java.sql.SQLException, RomulusException{        v.VisitQuestion(this);    }    }

⌨️ 快捷键说明

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