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

How to use
intValue
method
in
java.lang.Long

Best Java code snippets using java.lang.Long.intValue (Showing top 20 results out of 18,819)

origin: prestodb/presto

private static int comparatorResult(Long result)
{
  checkCondition(
      (result != null) && ((result == -1) || (result == 0) || (result == 1)),
      INVALID_FUNCTION_ARGUMENT,
      "Lambda comparator must return either -1, 0, or 1");
  return result.intValue();
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@SqlType("varchar(y)")
@LiteralParameters({"x", "y"})
public static Slice charToVarcharCast(@LiteralParameter("x") Long x, @LiteralParameter("y") Long y, @SqlType("char(x)") Slice slice)
{
  if (x.intValue() <= y.intValue()) {
    return padSpaces(slice, x.intValue());
  }
  return padSpaces(truncateToLength(slice, y.intValue()), y.intValue());
}
origin: prestodb/presto

@Override
protected Object getGreaterValue(Object value)
{
  int bits = ((Long) value).intValue();
  float greaterValue = intBitsToFloat(bits) + 0.1f;
  return Long.valueOf(floatToRawIntBits(greaterValue));
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@SqlType("char(y)")
@LiteralParameters({"x", "y"})
public static Slice varcharToCharCast(@LiteralParameter("y") Long y, @SqlType("varchar(x)") Slice slice)
{
  return truncateToLengthAndTrimSpaces(slice, y.intValue());
}
origin: spring-projects/spring-framework

@GetMapping(value = "/message-stream", produces = "application/x-protobuf;delimited=true")
Flux<Msg> messageStream() {
  return testInterval(Duration.ofMillis(50), 5).map(l ->
      Msg.newBuilder().setFoo("Foo").setBlah(SecondMsg.newBuilder().setBlah(l.intValue()).build()).build());
}
origin: ReactiveX/RxJava

@Test
public void simple() {
  Assert.assertEquals(0, Flowable.empty().count().blockingGet().intValue());
  Assert.assertEquals(1, Flowable.just(1).count().blockingGet().intValue());
  Assert.assertEquals(10, Flowable.range(1, 10).count().blockingGet().intValue());
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@SqlType("varchar(y)")
@LiteralParameters({"x", "y"})
public static Slice varcharToVarcharCast(@LiteralParameter("x") Long x, @LiteralParameter("y") Long y, @SqlType("varchar(x)") Slice slice)
{
  if (x > y) {
    return truncateToLength(slice, y.intValue());
  }
  else {
    return slice;
  }
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@SqlType("char(y)")
@LiteralParameters({"x", "y"})
public static Slice charToCharCast(@LiteralParameter("x") Long x, @LiteralParameter("y") Long y, @SqlType("char(x)") Slice slice)
{
  if (x > y) {
    return truncateToLength(slice, y.intValue());
  }
  else {
    return slice;
  }
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@LiteralParameters("x")
@SqlType(LikePatternType.NAME)
public static Regex castCharToLikePattern(@LiteralParameter("x") Long charLength, @SqlType("char(x)") Slice pattern)
{
  return likePattern(padSpaces(pattern, charLength.intValue()));
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@SqlType(CodePointsType.NAME)
@LiteralParameters("x")
public static int[] castCharToCodePoints(@LiteralParameter("x") Long charLength, @SqlType("char(x)") Slice slice)
{
  return castToCodePoints(padSpaces(slice, charLength.intValue()));
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@LiteralParameters("x")
@SqlType(JoniRegexpType.NAME)
public static Regex castCharToJoniRegexp(@LiteralParameter("x") Long charLength, @SqlType("char(x)") Slice pattern)
{
  return joniRegexp(padSpaces(pattern, charLength.intValue()));
}
origin: ReactiveX/RxJava

@Test
public void exactSequence() {
  Flowable.range(1, 5)
  .doOnRequest(this)
  .doOnCancel(this)
  .limit(5)
  .test()
  .assertResult(1, 2, 3, 4, 5);
  assertEquals(2, requests.size());
  assertEquals(5, requests.get(0).intValue());
  assertEquals(CANCELLED, requests.get(1));
}
origin: ReactiveX/RxJava

@Test(timeout = 2000)
public void backpressureWithBufferDropLatest() throws InterruptedException {
  int bufferSize = 3;
  final AtomicInteger droppedCount = new AtomicInteger(0);
  Action incrementOnDrop = new Action() {
    @Override
    public void run() throws Exception {
      droppedCount.incrementAndGet();
    }
  };
  TestSubscriber<Long> ts = createTestSubscriber();
  Flowable.fromPublisher(send500ValuesAndComplete.onBackpressureBuffer(bufferSize, incrementOnDrop, DROP_LATEST))
      .subscribe(ts);
  // we request 10 but only 3 should come from the buffer
  ts.request(10);
  ts.awaitTerminalEvent();
  assertEquals(bufferSize, ts.values().size());
  ts.assertNoErrors();
  assertEquals(0, ts.values().get(0).intValue());
  assertEquals(1, ts.values().get(1).intValue());
  assertEquals(499, ts.values().get(2).intValue());
  assertEquals(droppedCount.get(), 500 - bufferSize);
}
origin: ReactiveX/RxJava

@Test(timeout = 2000)
public void backpressureWithBufferDropOldest() throws InterruptedException {
  int bufferSize = 3;
  final AtomicInteger droppedCount = new AtomicInteger(0);
  Action incrementOnDrop = new Action() {
    @Override
    public void run() throws Exception {
      droppedCount.incrementAndGet();
    }
  };
  TestSubscriber<Long> ts = createTestSubscriber();
  Flowable.fromPublisher(send500ValuesAndComplete.onBackpressureBuffer(bufferSize, incrementOnDrop, DROP_OLDEST))
      .subscribe(ts);
  // we request 10 but only 3 should come from the buffer
  ts.request(10);
  ts.awaitTerminalEvent();
  assertEquals(bufferSize, ts.values().size());
  ts.assertNoErrors();
  assertEquals(497, ts.values().get(0).intValue());
  assertEquals(498, ts.values().get(1).intValue());
  assertEquals(499, ts.values().get(2).intValue());
  assertEquals(droppedCount.get(), 500 - bufferSize);
}
origin: ReactiveX/RxJava

@Test
public void shorterSequence() {
  Flowable.range(1, 5)
  .doOnRequest(this)
  .limit(6)
  .test()
  .assertResult(1, 2, 3, 4, 5);
  assertEquals(6, requests.get(0).intValue());
}
origin: ReactiveX/RxJava

@Test
public void longerSequence() {
  Flowable.range(1, 6)
  .doOnRequest(this)
  .limit(5)
  .test()
  .assertResult(1, 2, 3, 4, 5);
  assertEquals(5, requests.get(0).intValue());
}
origin: prestodb/presto

@ScalarFunction(value = "like", hidden = true)
@LiteralParameters("x")
@SqlType(StandardTypes.BOOLEAN)
public static boolean likeChar(@LiteralParameter("x") Long x, @SqlType("char(x)") Slice value, @SqlType(LikePatternType.NAME) Regex pattern)
{
  return likeVarchar(padSpaces(value, x.intValue()), pattern);
}
origin: prestodb/presto

@ScalarOperator(OperatorType.CAST)
@LiteralParameters("x")
@SqlType(JsonPathType.NAME)
public static JsonPath castCharToJsonPath(@LiteralParameter("x") Long charLength, @SqlType("char(x)") Slice pattern)
{
  return new JsonPath(padSpaces(pattern, charLength.intValue()).toStringUtf8());
}
origin: ReactiveX/RxJava

@Test
public void simpleFlowable() {
  Assert.assertEquals(0, Flowable.empty().count().toFlowable().blockingLast().intValue());
  Assert.assertEquals(1, Flowable.just(1).count().toFlowable().blockingLast().intValue());
  Assert.assertEquals(10, Flowable.range(1, 10).count().toFlowable().blockingLast().intValue());
}
origin: ReactiveX/RxJava

@Test
public void testSwitchWithProducer() throws Exception {
  final AtomicBoolean emitted = new AtomicBoolean(false);
  Flowable<Long> withProducer = Flowable.unsafeCreate(new Publisher<Long>() {
    @Override
    public void subscribe(final Subscriber<? super Long> subscriber) {
      subscriber.onSubscribe(new Subscription() {
        @Override
        public void request(long n) {
          if (n > 0 && emitted.compareAndSet(false, true)) {
            emitted.set(true);
            subscriber.onNext(42L);
            subscriber.onComplete();
          }
        }
        @Override
        public void cancel() {
        }
      });
    }
  });
  final Flowable<Long> flowable = Flowable.<Long>empty().switchIfEmpty(withProducer);
  assertEquals(42, flowable.blockingSingle().intValue());
}
java.langLongintValue

Javadoc

Returns the value of this Long as an int.

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
  • 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.
  • 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
  • Top PhpStorm 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