org.cpsolver.ifs.assignment

## Class EmptyAssignment<V extends Variable<V,T>,T extends Value<V,T>>

- java.lang.Object
- - org.cpsolver.ifs.assignment.AssignmentAbstract<V,T>
  - - org.cpsolver.ifs.assignment.EmptyAssignment<V,T>

- Type Parameters:
    `V` - Variable
    `T` - Value
  All Implemented Interfaces:
    Assignment<V,T>

      public class EmptyAssignment<V extends Variable<V,T>,T extends Value<V,T>>
      extends AssignmentAbstract<V,T>

  An empty assignment. All variables are unassigned, any attempt to assign a variable will throw the `UnsupportedOperationException` exception.
  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses.
  Author:
    Tomáš Müller

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.assignment.AssignmentAbstract

      `iContexts, iHasInitialzedContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmptyAssignment()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<V>` | `assignedVariables()` The list of assigned variables in the assignment.
    `long` | `getIteration(V variable)` Returns iteration of the last assignment.
    `protected T` | `getValueInternal(V variable)` Returns assignment of a variable, null if not assigned.
    `protected void` | `setValueInternal(long iteration, V variable, T value)` Sets an assignment to a variable (unassigns a variable if the given value is null).

    - ### Methods inherited from class org.cpsolver.ifs.assignment.AssignmentAbstract

      `assign, assign, assignedValues, clearContext, ensureInitializedContext, getAssignmentContext, getIndex, getValue, nrAssignedVariables, nrUnassignedVariables, unassign, unassign, unassignedVariables`

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

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

- - ### Constructor Detail

    - #### EmptyAssignment

          public EmptyAssignment()

  - ### Method Detail

    - #### getIteration

          public long getIteration(V variable)

      Description copied from interface: `Assignment`
      Returns iteration of the last assignment. Replacement for `Variable.getLastIteration()`.
      Parameters:
        `variable` - problem variable
      Returns:
        iteration of the last assignment

    - #### assignedVariables

          public Collection<V> assignedVariables()

      Description copied from interface: `Assignment`
      The list of assigned variables in the assignment. That is all the variables that `Assignment.getValue(Variable)` is not null in this assignment. Replacement for `Model.assignedVariables()`.
      Returns:
        a collection of assigned variable in this assignment

    - #### getValueInternal

          protected T getValueInternal(V variable)

      Description copied from class: `AssignmentAbstract`
      Returns assignment of a variable, null if not assigned. To be implemented.
      Specified by:
        `getValueInternal` in class `AssignmentAbstract<V extends Variable<V,T>,T extends Value<V,T>>`
      Parameters:
        `variable` - a variable in question
      Returns:
        assigned value

    - #### setValueInternal

          protected void setValueInternal(long iteration,
                                          V variable,
                                          T value)

      Description copied from class: `AssignmentAbstract`
      Sets an assignment to a variable (unassigns a variable if the given value is null). To be implemented.
      Specified by:
        `setValueInternal` in class `AssignmentAbstract<V extends Variable<V,T>,T extends Value<V,T>>`
      Parameters:
        `iteration` - current iteration
        `variable` - a variable to be assigned
        `value` - new assignment, null if to be unassigned