SHARE
TWEET

Answer.java

a guest Apr 21st, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.packt.siuo.domain;
  2.  
  3. import java.util.Date;
  4.  
  5. import com.packt.siuo.checker.MakeTextFile;
  6. import com.packt.siuo.checker.Compiler;
  7.  
  8. public class Answer {
  9.    
  10.     private String answerId;
  11.     private String userId;
  12.     private String exerciseId;
  13.     private String language;
  14.     private String code;
  15.     private Date date;
  16.     private Date usedTime;
  17.     private int usedMemory;
  18.     private String judgeResult;
  19.     private String judgeLog;
  20.    
  21.     public String getAnswerId(){
  22.         return answerId;
  23.     }
  24.     private void setAnswerId(String answerId){
  25.         this.answerId = answerId;
  26.     }
  27.     public String getExerciseId(){
  28.         return exerciseId;
  29.     }
  30.     private void setExerciseId(String exerciseId){
  31.         this.exerciseId = exerciseId;
  32.     }
  33.     public String getUserId(){
  34.         return userId;
  35.     }
  36.     private void setUserId(String userId){
  37.         this.userId =  userId;
  38.     }
  39.     public String getLanguage(){
  40.         return language;
  41.     }
  42.     private void setLanguage(String language){
  43.  
  44.         this.language = language;
  45.     }
  46.     public String getCode(){
  47.         return code;
  48.     }
  49.     private void setCode(String code){
  50.         this.code = code;
  51.     }
  52.     public Date getDate(){
  53.         return date;
  54.     }
  55.     private void setDate(){
  56.         date = new Date();
  57.     }
  58.     public Date getUsedTime(){
  59.         return usedTime;
  60.     }
  61.     private void setUsedTime(Date usedTime){
  62.         this.usedTime = usedTime;
  63.     }
  64.     public int getUsedMemory(){
  65.         return usedMemory;
  66.     }
  67.     private void setUsedMemory(int usedMemory){
  68.         this.usedMemory = usedMemory;
  69.     }
  70.     public String getJudgeResult(){
  71.         return judgeResult;
  72.     }
  73.     private void setJudgeLog(String judgeLog){
  74.         this.judgeLog = judgeLog;
  75.     }  
  76.     public String getJudgeLog(){
  77.         return judgeLog;
  78.     }
  79.     private void setJudgeResult(String judgeResult){
  80.         this.judgeResult = judgeResult;
  81.     }
  82.     public Answer (){
  83.         super();
  84.     }
  85.    
  86.     public Answer(String code){
  87.        
  88.         this.code=code;
  89.         //setLanguage("java");
  90.     }
  91.    
  92.     public Answer(String exerciseId, String userId, String language, String code) {
  93.         this.exerciseId = exerciseId;
  94.         this.userId = userId;
  95.         this.language = language;
  96.         this.code = code;
  97.     }
  98.    
  99.    
  100.     @Override
  101.     public boolean equals(Object obj){
  102.         if(this == obj)
  103.             return true;
  104.         if(getClass() != obj.getClass())
  105.             return false;
  106.         Answer other = (Answer) obj;
  107.         if (answerId == null) {
  108.             if(other.answerId != null)
  109.                 return false;
  110.         }
  111.         else if (!answerId.equals(other.answerId))
  112.             return false;
  113.         return true;
  114.     }
  115.    
  116.     @Override
  117.     public int hashCode(){
  118.         final int prime = 31;
  119.         int result = 1;
  120.         result = prime * result + ((answerId == null) ? 0 : answerId.hashCode());
  121.         return result;
  122.            
  123.        
  124.     }
  125.    
  126.    
  127. }
RAW Paste Data
Top