Show WootDel.java syntax highlighted
package fr.loria.ecoo.wooki.woot.op;
import java.io.Serializable;
import fr.loria.ecoo.wooki.woot.core.WootId;
import fr.loria.ecoo.wooki.woot.core.WootPage;
/**
* @author molli
*/
public class WootDel extends WootOp implements Serializable {
// private WootRow r;
private WootId rId;
private int indexRow;
public WootDel(WootPage page, WootId rowId) {
// this.setWootPage(wootPage);
// this.r = getWootPage().elementAt(getWootPage().indexOfId(rowId));
// this.r = page.elementAt(page.indexOfId(rowId));
this.rId = rowId;
}
/*
* public void execute(WootPage page) { //assert getWootPage().contains(r);
* //int index = getWootPage().indexOf(r); //getWootPage().elementAt(index +
* 1).setVisible(false); int index = page.indexOf(r); page.elementAt(index +
* 1).setVisible(false); }
*/
public void execute(WootPage page) {
page.elementAt(indexRow).setVisible(false);
}
public boolean precond(WootPage page) {
// return getWootPage().contains(r);
// return page.contains(r);
return page.containsById(rId);
}
public int precond_v2(WootPage page) {
// return getWootPage().contains(r);
return page.indexOfId(rId);
// return page.contains(r);
}
public String toString() {
return super.toString() + "del(" + rId + ")";
}
public int getIndexRow() {
return indexRow;
}
public void setIndexRow(int indexRow) {
this.indexRow = indexRow;
}
}
See more files for this project here
PeerWriter is a collaborative text editor. Multiple peers can edit the same document while they see overall changes in real-time. PeerWriter is based on a decentralized infrastructure, using a non-locking concurrency protocol ensuring global consistency.
Project homepage:
http://sourceforge.net/projects/peerwriter
Programming language(s): Java,XML
License: gpl2
WootDel.java
WootIns.java
WootOp.java