fib.java

来自「《Java案例开发》源代码( 考勤系统的完整实现!) 包括数据库 网络通讯&um」· Java 代码 · 共 96 行

JAVA
96
字号
/* * FIBItem.java * * Created on 2003年11月5日, 下午9:14 */package romulus;/** * * @author  Romulus * @version 1.0 */public class FIB implements QuestionItem {        /** The ident of the fib question.*/    private String ident = null;        /** The max chars of the fib.*/    private int maxc = 0;        /** The user's answer of the fib.*/    private String answer = null;        /** The content of the question item.*/    private Content cont = null;        /** The correct answer of the question.*/    private String corr_answer = null;        /** Creates a new instance of FIBItem */    FIB(String ident, int max, String c_ans) throws RomulusException{        if(ident == null){            throw new RomulusException(RomulusException.IdentError);        }        this.ident = ident;        this.maxc = max;        this.corr_answer = c_ans;    }        /** the answer is to public.*/    public void setAnswer(String ans){        this.answer = ans;    }        void setCorrectAnswer(String cans){        this.corr_answer = cans;    }        void setContent(Content c){        this.cont = c;    }        /** get information*/    public String getIdent(){        return this.ident;    }        public int getMaxchars(){        return this.maxc;    }        public String getCorrectAnswer(){        return this.corr_answer;    }        public String getAnswer(){        return this.answer;    }        public Content getContent(){        return this.cont;    }        /**     * Such method is used to check the correct of the question item.     */    public boolean isCorrect() {        if(answer == null){            return false;        }        else if(answer.equals(corr_answer)){            return true;        }        else{            return false;        }    }        /** The method used to accept the Visitor to do something. */    public void Accept(Visitor v) throws java.sql.SQLException, RomulusException{        v.VisitQuestionItem(this);    }    }

⌨️ 快捷键说明

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