Eclipse Platform
2.1

org.eclipse.jface.viewers
Interface IElementComparer


public interface IElementComparer

This interface is used to compare elements in a viewer for equality, and to provide the hash code for an element. This allows the client of the viewer to specify different equality criteria and a different hash code implementation than the equals and hashCode implementations of the elements themselves.

See Also:
StructuredViewer.setComparer(org.eclipse.jface.viewers.IElementComparer)

Method Summary
 boolean equals(Object a, Object b)
          Compares two elements for equality
 int hashCode(Object element)
          Returns the hash code for the given element.
 

Method Detail

equals

public boolean equals(Object a,
                      Object b)
Compares two elements for equality
Parameters:
a - the first element
b - the second element
Returns:
whether a is equal to b

hashCode

public int hashCode(Object element)
Returns the hash code for the given element.
Returns:
the hash code for the given element

Eclipse Platform
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.