Tabnine Logo
SignedUnaryNode.getSign
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Permission (java.security)
    Legacy security code; do not use.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top 12 Jupyter Notebook extensions
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