blob: d02f336040483b8581b6f7b7ff80eea7f4061a29 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard,
* Regent L'Archeveque,
* Olivier L. Larouche - initial API and implementation
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.common.emf.impl;
import java.util.Comparator;
import java.util.Iterator;
public class CompositeComparatorCustomImpl<T> extends CompositeComparatorImpl<T> {
public int compare(T o1, T o2) {
int result = 0;
Iterator<Comparator<T>> it = getComparators().iterator();
while (result == 0 && it.hasNext()) {
Comparator<T> comparator = it.next();
result = comparator.compare(o1, o2);
}
return result;
}
} // CompositeComparatorImpl