Codota Logo
SignedUnaryNode.getSign
Code IndexAdd Codota to your IDE (free)

How to use
getSign
method
in
org.kie.dmn.feel.lang.ast.SignedUnaryNode

Best Java code snippets using org.kie.dmn.feel.lang.ast.SignedUnaryNode.getSign (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: org.kie/kie-dmn-feel

@Override
public DirectCompilerResult visit(SignedUnaryNode n) {
  DirectCompilerResult result = n.getExpression().accept(this);
  if (n.getSign() == SignedUnaryNode.Sign.NEGATIVE) {
    return DirectCompilerResult.of(
        Expressions.negate(result.getExpression()),
        result.resultType,
        result.getFieldDeclarations());
  } else {
    return result;
  }
}
origin: org.kie/kie-dmn-feel

@Test
public void testNegativeFloatLiteral() {
  String inputExpression = "-10.5";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.NEGATIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10.5" ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testPositiveIntegerLiteral() {
  String inputExpression = "+10";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.POSITIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10" ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testPositiveFloatLiteral() {
  String inputExpression = "+10.5";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.POSITIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10.5" ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testNegativeIntegerLiteral() {
  String inputExpression = "-10";
  BaseNode number = parse( inputExpression );
  assertThat( number, is( instanceOf( SignedUnaryNode.class ) ) );
  assertThat( number.getResultType(), is( BuiltInType.NUMBER ) );
  assertLocation( inputExpression, number );
  SignedUnaryNode sun = (SignedUnaryNode) number;
  assertThat( sun.getSign(), is( SignedUnaryNode.Sign.NEGATIVE ) );
  assertThat( sun.getExpression(), is( instanceOf( NumberNode.class ) ) );
  assertThat( sun.getExpression().getText(), is( "10" ) );
}
org.kie.dmn.feel.lang.astSignedUnaryNodegetSign

Popular methods of SignedUnaryNode

  • getExpression
  • <init>
  • astEvent

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now