1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public boolean equals(Object o)
{
if(o==null)
return false;
if(!(o instanceof MyNode))
return false;
MyNode mn=(MyNode)o;
boolean result=true;
//si la string est differente
if(!toString().equals(mn.toString()))
result=false;
//si l'état du lock ou l'utilisateur qui a locke est different
if(lock!=mn.lock)
result=false;
else
if(userLock.equals(mn.userLock))
result=false;
/*if(this.isRoot() && mn.isRoot())
return true;*/
//enfin, si le numero du noeud dans l'affichage courant est different
int rowNbO = tree.getRowForPath(new TreePath(mn.getPath()));
int rowNb = tree.getRowForPath(new TreePath(this.getPath()));
if(rowNb != rowNbO)
result= false;
return result;
} |
Partager