Tabnine Logo
Long.compareTo
Code IndexAdd Tabnine to your IDE (free)

How to use
compareTo
method
in
java.lang.Long

Best Java code snippets using java.lang.Long.compareTo (Showing top 20 results out of 8,145)

origin: redisson/redisson

@Override
public int compareTo(MapKey o) {
  int compare = accessCount.compareTo(o.accessCount);
  if (compare == 0) {
    return cachedValue.id.compareTo(o.cachedValue.id);
  }
  return compare;
}
origin: redisson/redisson

@Override
public int compareTo(MapKey o) {
  int compare = accessCount.compareTo(o.accessCount);
  if (compare == 0) {
    return cachedValue.id.compareTo(o.cachedValue.id);
  }
  return compare;
}
origin: stackoverflow.com

 Collections.sort(list, new Comparator<Long>() {
  public int compare(Long o1, Long o2) {
    return o2.compareTo(o1);
  }
});
origin: bumptech/glide

 @Override
 public int compare(MediaStoreData mediaStoreData, MediaStoreData mediaStoreData2) {
  return Long.valueOf(mediaStoreData2.dateTaken).compareTo(mediaStoreData.dateTaken);
 }
});
origin: square/leakcanary

 @Override public int compare(AnalyzedHeap lhs, AnalyzedHeap rhs) {
  return Long.valueOf(rhs.selfFile.lastModified())
    .compareTo(lhs.selfFile.lastModified());
 }
});
origin: thinkaurelius/titan

@Override
public int compareTo(Vertex vertex) {
  return Long.valueOf(id).compareTo(vertex.id);
}
origin: square/leakcanary

 @Override public int compare(File lhs, File rhs) {
  return Long.valueOf(lhs.lastModified()).compareTo(rhs.lastModified());
 }
});
origin: apache/storm

  @Override
  public int compare(KinesisMessageId o1, KinesisMessageId o2) {
    return retryTimes.get(o1).compareTo(retryTimes.get(o2));
  }
}
origin: apache/storm

  @Override
  public int compare(FileStatus o1, FileStatus o2) {
    return new Long(o1.getModificationTime()).compareTo(o2.getModificationTime());
  }
}
origin: alibaba/jstorm

@Override
public int compare(String o1, String o2) {
  try {
    Long v1 = Long.valueOf(o1);
    Long v2 = Long.valueOf(o2);
    return v1.compareTo(v2);
  } catch (Exception e) {
    return o1.compareTo(o2);
  }
}
origin: apache/flink

  @Override
  public int compare(Tuple2<Long, Long> o1, Tuple2<Long, Long> o2) {
    return o1.f0.compareTo(o2.f0);
  }
});
origin: apache/storm

private Long getStoredCurrTransaction() {
  Long ret = INIT_TXID;
  for (TransactionalState state : _states) {
    Long curr = (Long) state.getData(CURRENT_TX);
    if (curr != null && curr.compareTo(ret) > 0) {
      ret = curr;
    }
  }
  return ret;
}
origin: com.h2database/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj instanceof Long && bObj instanceof Long) {
    Long a = (Long) aObj;
    Long b = (Long) bObj;
    return a.compareTo(b);
  }
  return super.compare(aObj, bObj);
}
origin: apache/storm

  @Override
  public int compare(RetrySchedule entry1, RetrySchedule entry2) {
    int result = Long.valueOf(entry1.nextRetryTimeNanos()).compareTo(entry2.nextRetryTimeNanos());
    
    if (result == 0) {
      //TreeSet uses compareTo instead of equals() for the Set contract
      //Ensure that we can save two retry schedules with the same timestamp
      result = entry1.hashCode() - entry2.hashCode();
    }
    return result;
  }
}
origin: code4craft/webmagic

  @Override
  public int compareTo(Delayed o) {
    return new Long(getDelay(TimeUnit.MILLISECONDS)).compareTo(o.getDelay(TimeUnit.MILLISECONDS));
  }
}
origin: apache/incubator-druid

@Override
public int compareTo(
  @NotNull OrderedSequenceNumber<Long> o
)
{
 return this.get().compareTo(o.get());
}
origin: google/guava

public void testCompare() {
 for (long x : VALUES) {
  for (long y : VALUES) {
   // note: spec requires only that the sign is the same
   assertEquals(x + ", " + y, Long.valueOf(x).compareTo(y), Longs.compare(x, y));
  }
 }
}
origin: apache/storm

  @Override
  public int compareTo(EventDataWrap ed) {
    return messageId.getSequenceNumber().
      compareTo(ed.getMessageId().getSequenceNumber());
  }
}
origin: junit-team/junit4

public int compare(Description o1, Description o2) {
  // Always prefer new tests
  if (isNewTest(o1)) {
    return -1;
  }
  if (isNewTest(o2)) {
    return 1;
  }
  // Then most recently failed first
  int result = getFailure(o2).compareTo(getFailure(o1));
  return result != 0 ? result
      // Then shorter tests first
      : getTestDuration(o1).compareTo(getTestDuration(o2));
}
origin: neo4j/neo4j

private List<PropertyContainer> sortedEntities( LinkedList<Pair<PropertyContainer, Long>> timestamps, final boolean reversed )
{
  List<Pair<PropertyContainer, Long>> sorted = new ArrayList<>( timestamps );
  sorted.sort( ( o1, o2 ) -> !reversed ? o1.other().compareTo( o2.other() ) : o2.other().compareTo( o1.other() ) );
  List<PropertyContainer> result = new ArrayList<>();
  for ( Pair<PropertyContainer, Long> timestamp : sorted )
  {
    result.add( timestamp.first() );
  }
  return result;
}
java.langLongcompareTo

Javadoc

Compares this object to the specified long object to determine their relative order.

Popular methods of Long

  • parseLong
    Parses the string argument as a signed long in the radix specified by the second argument. The chara
  • toString
    Returns a string representation of the first argument in the radix specified by the second argument.
  • valueOf
    Returns a Long object holding the value extracted from the specified String when parsed with the rad
  • longValue
    Returns the value of this Long as a long value.
  • <init>
    Constructs a newly allocated Long object that represents the long value indicated by the String para
  • intValue
    Returns the value of this Long as an int.
  • equals
    Compares this object to the specified object. The result is true if and only if the argument is not
  • hashCode
  • toHexString
    Returns a string representation of the longargument as an unsigned integer in base 16.The unsigned l
  • compare
    Compares two long values numerically. The value returned is identical to what would be returned by:
  • doubleValue
    Returns the value of this Long as a double.
  • decode
    Decodes a String into a Long. Accepts decimal, hexadecimal, and octal numbers given by the following
  • doubleValue,
  • decode,
  • numberOfLeadingZeros,
  • numberOfTrailingZeros,
  • bitCount,
  • signum,
  • reverseBytes,
  • toBinaryString,
  • shortValue

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • getResourceAsStream (ClassLoader)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now