All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.container.pair.ComparablePair Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.container.pair;

/**
 * The default implementation of {@link IComparablePair}.
 * 
 * @author Oliver Richers
 */
public class ComparablePair, B extends Comparable> extends Pair implements IComparablePair {

	public ComparablePair(A first, B second) {

		super(first, second);
	}

	@Override
	public int compareTo(IComparablePair other) {

		int cmp = getFirst().compareTo(other.getFirst());
		return cmp != 0? cmp : getSecond().compareTo(other.getSecond());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy