public class DeletionMove extends AbstractSubsetMove
Constructor and Description |
---|
DeletionMove(int delete)
Create a new deletion move, specifying the ID that will be removed from the selection
when this moves is applied to a given subset solution.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(SubsetSolution solution)
Apply this deletion move to the given subset solution.
|
Set<Integer> |
getAddedIDs()
Returns an unmodifiable empty set, as no IDs are added.
|
int |
getDeletedID()
Returns the deleted ID.
|
Set<Integer> |
getDeletedIDs()
Returns an unmodifiable singleton, containing the only deleted ID.
|
int |
getNumAdded()
Always returns 0, as no IDs are added.
|
int |
getNumDeleted()
Always returns 1, as a single ID is deleted.
|
void |
undo(SubsetSolution solution)
Undo this deletion move after it has been successfully applied to the given subset solution, by re-adding the
deleted ID to the selection.
|
equals, hashCode
public DeletionMove(int delete)
delete
- ID to be removed from the selectionpublic Set<Integer> getAddedIDs()
public Set<Integer> getDeletedIDs()
public int getDeletedID()
public int getNumAdded()
public int getNumDeleted()
public void apply(SubsetSolution solution)
undo(SubsetSolution)
will correctly undo the move.solution
- solution to which to move is appliedSolutionModificationException
- if the deleted ID is currently not selected or does not correspond to an entitypublic void undo(SubsetSolution solution)
solution
- solution to which the move has been appliedCopyright © 2016. All rights reserved.