Newer
Older
CitrusClient / app / src / main / java / com / example / citrusclient / models / Todo.java
t-watanabe on 26 Sep 1 KB カレンダー完成
  1. package com.example.citrusclient.models;
  2.  
  3. import java.util.List;
  4.  
  5. public class Todo extends Task{
  6.  
  7.  
  8. boolean check;
  9. int year;
  10. int month;
  11. int day;
  12. Integer todoId;
  13.  
  14. //コンストラクタ
  15. public Todo(String title, boolean check, int year, int month, int day, Integer tid, Integer bid) {
  16. this.title = title;
  17. this.check = check;
  18. this.year = year;
  19. this.month = month;
  20. this.day = day;
  21. todoId = tid;
  22. this.bookId = bid;
  23. }
  24.  
  25. public Todo(){}
  26.  
  27.  
  28.  
  29. //セッター
  30. public void setCheck(boolean check) {this.check = check;}
  31. public void setYear(int year) {this.year = year;}
  32. public void setMonth(int month) {this.month = month;}
  33. public void setDay(int day) {this.day = day;}
  34. public void setTodoId(Integer tid) {this.todoId = tid;}
  35.  
  36. //ゲッター
  37.  
  38. public boolean getCheck() {return check;}
  39.  
  40. public int getYear() {return year;}
  41.  
  42. public int getMonth() {return month;}
  43.  
  44. public int getDay() {return day;}
  45.  
  46. public Integer getTodoId() {
  47. return todoId;
  48. }
  49.  
  50. public boolean containsTodo(List<Todo> todoList){
  51. for(Todo todo : todoList) {
  52. if(todo.bookId == this.bookId && todo.year == this.year && todo.month == this.month && todo.day == this.day && todo.todoId == this.todoId) {
  53. return true;
  54. }
  55. }
  56. return false;
  57. }
  58. }