[ictk] equals and hashcode in ContinuationArrayList
chess library in java, PGN, FEN, ICS
                
                Brought to you by:
                
                    jvarsoke
                    
                
            
            
        
        
        
    | 
     
      
      
      From: Diego A. <die...@we...> - 2005-12-11 13:48:36
      
     
   | 
In the class ictk.boardgame.ContinuationArrayList  I added the methods equals and hashCode, which I need for my little project
public boolean equals(Object o) {
	   if (o == this) return true;
	   if ((o == null) || (o.getClass() != this.getClass()))
	         return false;
	   ContinuationArrayList otherList = (ContinuationArrayList)o;
	   boolean branchesEqual = Arrays.equals(branches,otherList.branches);
	   boolean departureEqual = departureMove.equals(otherList.departureMove);
	   return branchesEqual && departureEqual;
   }
   
   public int hashCode() {
	   int hash = 7;
	   hash = 31 * hash + ((branches == null) ? 0 : branches.hashCode());
	   hash = 31 * hash + ((departureMove == null) ? 0 : departureMove.hashCode());
	   return hash;
   }
 |