org.cpsolver.instructor.constraints

## Class SameInstructorConstraint.Context

- java.lang.Object
- - org.cpsolver.instructor.constraints.SameInstructorConstraint.Context

- All Implemented Interfaces:
    AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>, AssignmentContext
  Enclosing class:
    SameInstructorConstraint

      public class SameInstructorConstraint.Context
      extends Object
      implements AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>

  Same Instructor Constraint Context. This context keeps the last preference value and updates the `SameInstructor` criterion.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Context(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, TeachingAssignment value)` Called when `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
    `int` | `getPreference()` Current preference value (see `SameInstructorConstraint.getCurrentPreference(Assignment)`)
    `void` | `unassigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, TeachingAssignment value)` Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Context

          public Context(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment)

  - ### Method Detail

    - #### assigned

          public void assigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
                               TeachingAssignment value)

      Description copied from interface: `AssignmentConstraintContext`
      Called when `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
      Specified by:
        `assigned` in interface `AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `value` - assigned value

    - #### unassigned

          public void unassigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
                                 TeachingAssignment value)

      Description copied from interface: `AssignmentConstraintContext`
      Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.
      Specified by:
        `unassigned` in interface `AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `value` - unassigned value

    - #### getPreference

          public int getPreference()

      Current preference value (see `SameInstructorConstraint.getCurrentPreference(Assignment)`)
      Returns:
        current preference value