congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Long.compareUnsigned
Code IndexAdd Tabnine to your IDE (free)

How to use
compareUnsigned
method
in
java.lang.Long

Best Java code snippets using java.lang.Long.compareUnsigned (Showing top 20 results out of 504)

origin: prestodb/presto

public static int compareUnsigned(long leftRawLow, long leftRawHigh, long rightRawLow, long rightRawHigh)
{
  if (leftRawHigh != rightRawHigh) {
    return Long.compareUnsigned(leftRawHigh, rightRawHigh);
  }
  if (leftRawLow != rightRawLow) {
    return Long.compareUnsigned(leftRawLow, rightRawLow);
  }
  return 0;
}
origin: prestodb/presto

public static int compareUnsigned(long leftRawLow, long leftRawHigh, long rightRawLow, long rightRawHigh)
{
  if (leftRawHigh != rightRawHigh) {
    return Long.compareUnsigned(leftRawHigh, rightRawHigh);
  }
  if (leftRawLow != rightRawLow) {
    return Long.compareUnsigned(leftRawLow, rightRawLow);
  }
  return 0;
}
origin: neo4j/neo4j

private static void doCheckAccess( long pointer, int size )
{
  long boundary = pointer + size;
  Allocation allocation = lastUsedAllocation.get();
  if ( allocation != null )
  {
    if ( compareUnsigned( allocation.pointer, pointer ) <= 0 &&
       compareUnsigned( allocation.boundary, boundary ) > 0 &&
       allocation.freeCounter == freeCounter.get() )
    {
      return;
    }
  }
  Map.Entry<Long,Allocation> fentry = allocations.floorEntry( boundary );
  if ( fentry == null || compareUnsigned( fentry.getValue().boundary, boundary ) < 0 )
  {
    Map.Entry<Long,Allocation> centry = allocations.ceilingEntry( pointer );
    throwBadAccess( pointer, size, fentry, centry );
  }
  //noinspection ConstantConditions
  lastUsedAllocation.set( fentry.getValue() );
}
origin: prestodb/presto

public static int compareAbsolute(Slice left, Slice right)
{
  long leftHigh = getLong(left, 1);
  long rightHigh = getLong(right, 1);
  if (leftHigh != rightHigh) {
    return Long.compareUnsigned(leftHigh, rightHigh);
  }
  long leftLow = getLong(left, 0);
  long rightLow = getLong(right, 0);
  if (leftLow != rightLow) {
    return Long.compareUnsigned(leftLow, rightLow);
  }
  return 0;
}
origin: prestodb/presto

public static int compareAbsolute(Slice left, Slice right)
{
  long leftHigh = getLong(left, 1);
  long rightHigh = getLong(right, 1);
  if (leftHigh != rightHigh) {
    return Long.compareUnsigned(leftHigh, rightHigh);
  }
  long leftLow = getLong(left, 0);
  long rightLow = getLong(right, 0);
  if (leftLow != rightLow) {
    return Long.compareUnsigned(leftLow, rightLow);
  }
  return 0;
}
origin: prestodb/presto

@UsedByGeneratedCode
public static long divideShortShortShort(long dividend, long divisor, int rescaleFactor)
{
  if (divisor == 0) {
    throw new PrestoException(DIVISION_BY_ZERO, "Division by zero");
  }
  if (dividend == 0) {
    return 0;
  }
  int resultSignum = signum(dividend) * signum(divisor);
  long unsignedDividend = abs(dividend);
  long unsignedDivisor = abs(divisor);
  long rescaledUnsignedDividend = unsignedDividend * longTenToNth(rescaleFactor);
  long quotient = rescaledUnsignedDividend / unsignedDivisor;
  long remainder = rescaledUnsignedDividend - (quotient * unsignedDivisor);
  if (Long.compareUnsigned(remainder * 2, unsignedDivisor) >= 0) {
    quotient++;
  }
  return resultSignum * quotient;
}
origin: prestodb/presto

while (Long.compareUnsigned(rhat, INT_BASE) < 0 && Long.compareUnsigned((v0 & LONG_MASK) * qhat, combineInts(lowInt(rhat), u0)) > 0) {
  iterations++;
  qhat--;
origin: prestodb/presto

while (Long.compareUnsigned(rhat, INT_BASE) < 0 && Long.compareUnsigned((v0 & LONG_MASK) * qhat, combineInts(lowInt(rhat), u0)) > 0) {
  iterations++;
  qhat--;
origin: apache/metron

public static boolean greaterThanOrEqualTo(long a, long b) {
 return Long.compareUnsigned(a, b) >= 0;
}
origin: apache/metron

public static boolean lessThanOrEqualTo(long a, long b) {
 return Long.compareUnsigned(a, b) <= 0;
}
origin: org.elasticsearch/elasticsearch

if (pSize != 0 && (qSize == 0 || q == null || Long.compareUnsigned(p.morton, q.morton) <= 0)) {
 e = p;
 p = p.nextZ;
origin: RoaringBitmap/RoaringBitmap

@Override
public long rangeCardinality(long start, long end) {
 if(Long.compareUnsigned(start, end) >= 0) {
  return 0;
 }
 long size = 0;
 int startIndex = this.highLowContainer.getIndex(Util.highbits(start));
 if(startIndex < 0)  {
  startIndex = -startIndex - 1;
 } else {
  int inContainerStart = Util.toIntUnsigned(Util.lowbits(start));
  if(inContainerStart != 0) {
   size -= this.highLowContainer
    .getContainerAtIndex(startIndex)
    .rank((short)(inContainerStart - 1));
  }
 }
 short xhigh = Util.highbits(end - 1);
 for (int i = startIndex; i < this.highLowContainer.size(); i++) {
  short key = this.highLowContainer.getKeyAtIndex(i);
  int comparison = Util.compareUnsigned(key, xhigh);
  if (comparison < 0) {
   size += this.highLowContainer.getContainerAtIndex(i).getCardinality();
  } else if (comparison == 0) {
   return size + this.highLowContainer
    .getContainerAtIndex(i).rank(Util.lowbits((int)(end - 1)));
  }
 }
 return size;    
}
origin: RoaringBitmap/RoaringBitmap

@Override
public long rangeCardinality(long start, long end) {
 if(Long.compareUnsigned(start, end) >= 0) {
  return 0;
origin: apache/metron

private void turnoverIfNecessary(long ts, boolean force) throws IOException {
 long duration = ts - batchStartTime;
 boolean initial = outputStream == null;
 boolean overDuration = config.getMaxTimeNS() <= 0 ? false : Long.compareUnsigned(duration, config.getMaxTimeNS()) >= 0;
 boolean tooManyPackets = numWritten >= config.getNumPackets();
 if(force || initial || overDuration || tooManyPackets ) {
origin: org.graalvm.compiler/compiler

public static long minUnsigned(long a, long b) {
  if (Long.compareUnsigned(a, b) < 0) {
    return a;
  }
  return b;
}
origin: com.truward.tupl/tupl

static void p_bytePut(final long page, int index, byte v) {
  if (CHECK_BOUNDS && Long.compareUnsigned(index, CHECKED_PAGE_SIZE) >= 0) {
    throw new ArrayIndexOutOfBoundsException(index);
  }
  UNSAFE.putByte(page + index, v);
}
origin: org.cojen/tupl

static void p_bytePut(final long page, int index, byte v) {
  if (CHECK_BOUNDS && Long.compareUnsigned(index, CHECKED_PAGE_SIZE) >= 0) {
    throw new ArrayIndexOutOfBoundsException(index);
  }
  UNSAFE.putByte(page + index, v);
}
origin: org.elasticsearch/elasticsearch

private static void validateScoresDoNotIncreaseWithNorm(Version indexCreatedVersion, Similarity similarity) throws IOException {
  CollectionStatistics collectionStats = new CollectionStatistics("some_field", 1200, 1100, 3000, 2000);
  TermStatistics termStats = new TermStatistics(new BytesRef("some_value"), 100, 130);
  SimWeight simWeight = similarity.computeWeight(2f, collectionStats, termStats);
  SimScorer previousScorer = null;
  long previousNorm = 0;
  float previousScore = Float.POSITIVE_INFINITY;
  for (int length = 1; length <= 10; ++length) {
    FieldInvertState state = new FieldInvertState(indexCreatedVersion.luceneVersion.major,
        "some_field", length, length, 0, 50); // length = 20, no overlap
    final long norm = similarity.computeNorm(state);
    if (Long.compareUnsigned(previousNorm, norm) > 0) {
      // esoteric similarity, skip this check
      break;
    }
    LeafReader reader = new SingleNormLeafReader(norm);
    SimScorer scorer = similarity.simScorer(simWeight, reader.getContext());
    float score = scorer.score(0, 1);
    if (score > previousScore) {
      DEPRECATION_LOGGER.deprecated("Similarity scores should not increase when norm increases:\n" +
          previousScorer.explain(0, Explanation.match(1, "term freq")) + "\n" +
          scorer.explain(0, Explanation.match(1, "term freq")));
      break;
    }
    previousScorer = scorer;
    previousScore = score;
    previousNorm = norm;
  }
}
origin: net.imglib2/imglib2

@Override
public int compareTo( final Unsigned128BitType t )
{
  final long upper1 = dataAccess.getValue( i * 2 + 1 );
  final long upper2 = t.dataAccess.getValue( t.i * 2 + 1 );
  final int compareUpper = Long.compareUnsigned( upper1, upper2 );
  if ( compareUpper != 0 )
    return compareUpper;
  final long lower1 = dataAccess.getValue( i * 2 );
  final long lower2 = t.dataAccess.getValue( t.i * 2 );
  return Long.compareUnsigned( lower1, lower2 );
}
origin: org.elasticsearch/elasticsearch

while (p != null && Long.compareUnsigned(p.morton, minZ) >= 0
  && n != null && Long.compareUnsigned(n.morton, maxZ) <= 0) {
 if (p.idx != ear.previous.idx && p.idx != ear.next.idx &&
   pointInEar(p.getX(), p.getY(), ear.previous.getX(), ear.previous.getY(), ear.getX(), ear.getY(),
while (p != null && Long.compareUnsigned(p.morton, minZ) >= 0) {
 if (p.idx != ear.previous.idx && p.idx != ear.next.idx
    && pointInEar(p.getX(), p.getY(), ear.previous.getX(), ear.previous.getY(), ear.getX(), ear.getY(),
  Long.compareUnsigned(n.morton, maxZ) <= 0) {
  if (n.idx != ear.previous.idx && n.idx != ear.next.idx
    && pointInEar(n.getX(), n.getY(), ear.previous.getX(), ear.previous.getY(), ear.getX(), ear.getY(),
java.langLongcompareUnsigned

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
  • compareTo
    Compares this Long object to another object. If the object is a Long, this function behaves likecomp
  • 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.
  • compare,
  • doubleValue,
  • decode,
  • numberOfLeadingZeros,
  • numberOfTrailingZeros,
  • bitCount,
  • signum,
  • reverseBytes,
  • toBinaryString,
  • shortValue

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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