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

com.github.TKnudsen.ComplexDataObject.model.comparators.NumberComparator Maven / Gradle / Ivy

Go to download

A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.

The newest version!
package com.github.TKnudsen.ComplexDataObject.model.comparators;

import java.util.Comparator;

/**
 * 

* Title: NumberComparator *

* *

* Description: compares numbers *

* *

* Copyright: Copyright (c) 2018 *

* * @author Juergen Bernard * @version 1.01 */ public class NumberComparator implements Comparator { @Override public int compare(Number x, Number y) { if (x == null && y == null) return 0; if (x == null) return 1; else if (y == null) return -1; Double a = x.doubleValue(); Double b = y.doubleValue(); return Double.compare(a, b); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy