示例#1
0
 /**
  * Save the new criterion to the database.
  *
  * @return true if the criterion is successfully saved, otherwise false
  */
 public boolean save() {
   if (criterion.getName().isEmpty()) {
     error = "Criterion name must not be empty!";
     return false;
   }
   dao.save(criterion);
   notifyObservers();
   return true;
 }
示例#2
0
 /**
  * Returns the name of the criterion.
  *
  * @return name of the criterion
  */
 public String getName() {
   return criterion.getName();
 }
示例#3
0
 /**
  * Set the name of the chosen criterion.
  *
  * @param name new name of the criterion
  */
 public void setName(String name) {
   criterion.setName(name);
 }