Category.java 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package classes;
  2. import java.util.ArrayList;
  3. import Interfaces.ComparableObject;
  4. public class Category implements ComparableObject{
  5. private int ID;
  6. private ArrayList<CpsObject> objects;
  7. private String name;
  8. public Category(String name){
  9. setObjects(new ArrayList<CpsObject>());
  10. setName(name);
  11. setID(-1);
  12. }
  13. /**
  14. * @return the id
  15. */
  16. public int getID() {
  17. return ID;
  18. }
  19. /**
  20. * @param id the id to set
  21. */
  22. public void setID(int id) {
  23. this.ID = id;
  24. }
  25. /**
  26. * @return the objects
  27. */
  28. public ArrayList<CpsObject> getObjects() {
  29. return objects;
  30. }
  31. /**
  32. * @param objects the objects to set
  33. */
  34. public void setObjects(ArrayList<CpsObject> objects) {
  35. this.objects = objects;
  36. }
  37. /**
  38. * @return the name
  39. */
  40. public String getName() {
  41. return name;
  42. }
  43. /**
  44. * @param name the name to set
  45. */
  46. public void setName(String name) {
  47. this.name = name;
  48. }
  49. @Override
  50. public String getCompareName() {
  51. return getName();
  52. }
  53. }