KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > compare > structuremergeviewer > IStructureComparator


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.compare.structuremergeviewer;
12
13 /**
14  * Interface used to compare hierarchical structures.
15  * It is used by the differencing engine.
16  * <p>
17  * Clients typically implement this interface in an adaptor class which
18  * wrappers the objects to be compared.
19  *
20  * @see org.eclipse.compare.ResourceNode
21  * @see Differencer
22  */

23 public interface IStructureComparator {
24
25     /**
26      * Returns an iterator for all children of this object or <code>null</code>
27      * if there are no children.
28      *
29      * @return an array with all children of this object, or an empty array if there are no children
30      */

31     Object JavaDoc[] getChildren();
32
33     /**
34      * Returns whether some other object is "equal to" this one
35      * with respect to a structural comparison. For example, when comparing
36      * Java class methods, <code>equals</code> would return <code>true</code>
37      * if two methods have the same signature (the argument names and the
38      * method body might differ).
39      *
40      * @param other the reference object with which to compare
41      * @return <code>true</code> if this object is the same as the other argument; <code>false</code> otherwise
42      * @see java.lang.Object#equals
43      */

44     boolean equals(Object JavaDoc other);
45 }
46
Popular Tags