Example usage for java.lang Long compare

List of usage examples for java.lang Long compare

Introduction

In this page you can find the example usage for java.lang Long compare.

Prototype

public static int compare(long x, long y) 

Source Link

Document

Compares two long values numerically.

Usage

From source file:dlauncher.modpacks.packs.VanillaModPackVersion.java

@Override
public int compareTo(ModPackVersion o) {
    return Long.compare(this.releaseDate, o.getReleaseDate());
}

From source file:net.mintern.primitive.pair.LongPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *///from  w  w  w.ja  v a  2 s  .  c o  m
@Override
public int compareTo(LongPair other) {
    int cmp = Long.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Long.compare(getRight(), other.getRight());
}

From source file:de.shadowhunt.subversion.Revision.java

@Override
public int compareTo(final Revision other) {
    return Long.compare(version, other.version);
}

From source file:net.mintern.primitive.pair.LongIntPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *//* w w  w.  j av  a2  s .  co m*/
@Override
public int compareTo(LongIntPair other) {
    int cmp = Long.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Integer.compare(getRight(), other.getRight());
}

From source file:net.mintern.primitive.pair.LongBytePair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *//*from   w w  w. j ava2s . c o m*/
@Override
public int compareTo(LongBytePair other) {
    int cmp = Long.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Byte.compare(getRight(), other.getRight());
}

From source file:net.mintern.primitive.pair.LongCharPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *//*from  www  .j  av a  2 s .co m*/
@Override
public int compareTo(LongCharPair other) {
    int cmp = Long.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Character.compare(getRight(), other.getRight());
}

From source file:net.mintern.primitive.pair.LongFloatPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *///from  w  ww .j a va2  s.c  o  m
@Override
public int compareTo(LongFloatPair other) {
    int cmp = Long.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Float.compare(getRight(), other.getRight());
}

From source file:net.mintern.primitive.pair.LongBooleanPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *///from  w  w  w .j  ava  2  s  .c  om
@Override
public int compareTo(LongBooleanPair other) {
    int cmp = Long.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Boolean.compare(getRight(), other.getRight());
}

From source file:net.mintern.primitive.pair.ByteLongPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *///  w w w. j av a  2  s .  c  o  m
@Override
public int compareTo(ByteLongPair other) {
    int cmp = Byte.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Long.compare(getRight(), other.getRight());
}

From source file:net.mintern.primitive.pair.IntLongPair.java

/**
 * Compares the pair based on the left element followed by the right element.
 *
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 *//*  w w w .  ja  v a2  s.  com*/
@Override
public int compareTo(IntLongPair other) {
    int cmp = Integer.compare(getLeft(), other.getLeft());
    return cmp != 0 ? cmp : Long.compare(getRight(), other.getRight());
}