Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * 
   */
  package net.officefloor.model.desk;
  
  
 
 @Generated("net.officefloor.model.generate.ModelGenerator")
 public class TaskToNextTaskModel extends AbstractModel implements ConnectionModel {
 
     public static enum TaskToNextTaskEvent {
      CHANGE_NEXT_TASK_NAME, CHANGE_PREVIOUS_TASK, CHANGE_NEXT_TASK
     }

    
Default constructor.
 
     public TaskToNextTaskModel() {
     }

    
Convenience constructor for new non-linked instance.
 
     public TaskToNextTaskModel(
       String nextTaskName
     ) {
         this. = nextTaskName;
     }

    
Convenience constructor.
 
     public TaskToNextTaskModel(
       String nextTaskName
     , TaskModel previousTask
     , TaskModel nextTask
     ) {
         this. = nextTaskName;
         this. = previousTask;
         this. = nextTask;
     }

    
Convenience constructor allowing XY initialising.
 
     public TaskToNextTaskModel(
       String nextTaskName
     , TaskModel previousTask
     , TaskModel nextTask
     , int x
     , int y
     ) {
         this. = nextTaskName;
         this. = previousTask;
         this. = nextTask;
         this.setX(x);
         this.setY(y);
     }

    
Next task name.
 
     private String nextTaskName;
 
     public String getNextTaskName() {
         return this.;
     }
 
     public void setNextTaskName(String nextTaskName) {
         String oldValue = this.;
         this. = nextTaskName;
         this.changeField(oldValuethis..);
     }

    
Previous task.
 
     private TaskModel previousTask;
 
     public TaskModel getPreviousTask() {
         return this.;
     }
 
     public void setPreviousTask(TaskModel previousTask) {
         TaskModel oldValue = this.;
         this. = previousTask;
         this.changeField(oldValuethis..);
     }

    
Next task.
 
     private TaskModel nextTask;
 
     public TaskModel getNextTask() {
         return this.;
    }
    public void setNextTask(TaskModel nextTask) {
        TaskModel oldValue = this.;
        this. = nextTask;
        this.changeField(oldValuethis..);
    }
    /*
     * ConnectionModel
     */
    public boolean isRemovable() {
        return true;
    }
    public void connect() {
        this..setNextTask(this);
        this..addPreviousTask(this);
    }
    public void remove() {
        this..setNextTask(null);
        this..removePreviousTask(this);
    }
New to GrepCode? Check out our FAQ X