|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfreerails.move.ChangeItemInListMove
public class ChangeItemInListMove
All Moves that replace an item in a list with another should extend this class.
| Field Summary | |
|---|---|
private FreerailsSerializable |
after
|
private FreerailsSerializable |
before
|
private int |
index
|
private KEY |
listKey
|
private FreerailsPrincipal |
principal
|
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
ChangeItemInListMove(KEY k,
int index,
FreerailsSerializable before,
FreerailsSerializable after,
FreerailsPrincipal p)
|
|
| Method Summary | |
|---|---|
boolean |
beforeEqualsAfter()
|
MoveStatus |
doMove(World w,
FreerailsPrincipal p)
Executes this move on the specifed world object. |
boolean |
equals(java.lang.Object o)
|
FreerailsSerializable |
getAfter()
|
FreerailsSerializable |
getBefore()
|
int |
getIndex()
|
KEY |
getKey()
|
FreerailsPrincipal |
getPrincipal()
|
int |
hashCode()
|
protected MoveStatus |
move(FreerailsSerializable to,
FreerailsSerializable from,
World w)
|
java.lang.String |
toString()
|
MoveStatus |
tryDoMove(World w,
FreerailsPrincipal p)
Tests whether this Move can be executed on the specifed world object, this method should leave the world object unchanged. |
protected MoveStatus |
tryMove(FreerailsSerializable to,
FreerailsSerializable from,
World w)
|
MoveStatus |
tryUndoMove(World w,
FreerailsPrincipal p)
Tests whether this Move can be undone on the specifed world object, this method should leave the world object unchanged. |
MoveStatus |
undoMove(World w,
FreerailsPrincipal p)
If doMove has just been executed on the specified world
object, calling this method changes the state of the world object back to
how it was before doMove was called. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private final KEY listKey
private final int index
private final FreerailsSerializable before
private final FreerailsSerializable after
private final FreerailsPrincipal principal
| Constructor Detail |
|---|
public ChangeItemInListMove(KEY k,
int index,
FreerailsSerializable before,
FreerailsSerializable after,
FreerailsPrincipal p)
| Method Detail |
|---|
public boolean beforeEqualsAfter()
public MoveStatus doMove(World w,
FreerailsPrincipal p)
Move
doMove in interface Movepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic FreerailsSerializable getAfter()
getAfter in interface ListMovepublic FreerailsSerializable getBefore()
getBefore in interface ListMovepublic int getIndex()
getIndex in interface ListMovepublic KEY getKey()
getKey in interface ListMovepublic FreerailsPrincipal getPrincipal()
getPrincipal in interface ListMovepublic int hashCode()
hashCode in class java.lang.Object
protected MoveStatus move(FreerailsSerializable to,
FreerailsSerializable from,
World w)
public java.lang.String toString()
toString in class java.lang.Object
public MoveStatus tryDoMove(World w,
FreerailsPrincipal p)
Move
tryDoMove in interface Move
protected MoveStatus tryMove(FreerailsSerializable to,
FreerailsSerializable from,
World w)
public MoveStatus tryUndoMove(World w,
FreerailsPrincipal p)
Move
tryUndoMove in interface Move
public MoveStatus undoMove(World w,
FreerailsPrincipal p)
MovedoMove has just been executed on the specified world
object, calling this method changes the state of the world object back to
how it was before doMove was called.
undoMove in interface Move
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||