Tabnine Logo
IntValue.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.eclipse.incquery.patternlanguage.patternLanguage.IntValue

Best Java code snippets using org.eclipse.incquery.patternlanguage.patternLanguage.IntValue.getValue (Showing top 4 results out of 315)

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

private String getConstantAsString(ValueReference ref) {
  if (ref instanceof IntValue) {
    return Integer.toString(((IntValue) ref).getValue());
  } else if (ref instanceof DoubleValue) {
    return Double.toString(((DoubleValue) ref).getValue());
  } else if (ref instanceof BoolValue) {
    return Boolean.toString(((BoolValue) ref).isValue());
  } else if (ref instanceof StringValue) {
    return "\"" + ((StringValue) ref).getValue() + "\"";
  } else if (ref instanceof ListValue) {
    StringBuilder sb = new StringBuilder();
    sb.append("{ ");
    for (Iterator<ValueReference> iter = ((ListValue) ref).getValues().iterator(); iter.hasNext();) {
      sb.append(getConstantAsString(iter.next()));
      if (iter.hasNext()) {
        sb.append(", ");
      }
    }
    sb.append("}");
    return sb.toString();
  } else if (ref instanceof VariableValue) {
    return ((VariableValue) ref).getValue().getVar();
  }
  return "UNDEFINED";
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

private static Object getValue(ValueReference ref) {
  Object value = null;
  if (ref instanceof BoolValue) {
    value = ((BoolValue)ref).isValue();
  } else if (ref instanceof DoubleValue) {
    value = ((DoubleValue)ref).getValue();
  } else if (ref instanceof IntValue) {
    value = ((IntValue)ref).getValue();
  } else if (ref instanceof StringValue) {
    value = ((StringValue)ref).getValue();
  } else if (ref instanceof VariableReference) {
    value = new ParameterReference(((VariableReference) ref).getVar());
  } else if (ref instanceof VariableValue) {
    value = new ParameterReference(((VariableValue)ref).getValue().getVar());
  } else if (ref instanceof ListValue) {
    value = Lists.transform(((ListValue) ref).getValues(), new Function<ValueReference, Object>() {
      @Override
      public Object apply(ValueReference ref) {
        return getValue(ref);
      }
    });
  } else {
    throw new UnsupportedOperationException("Unknown attribute parameter type");
  }
  return value;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

/**
 * Contexts:
 *     ValueReference returns IntValue
 *     AnnotationValueReference returns IntValue
 *     LiteralValueReference returns IntValue
 *     IntValue returns IntValue
 *
 * Constraint:
 *     value=INTNUMBER
 */
protected void sequence_IntValue(ISerializationContext context, IntValue semanticObject) {
  if (errorAcceptor != null) {
    if (transientValues.isValueTransient(semanticObject, PatternLanguagePackage.Literals.INT_VALUE__VALUE) == ValueTransient.YES)
      errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PatternLanguagePackage.Literals.INT_VALUE__VALUE));
  }
  SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
  feeder.accept(grammarAccess.getIntValueAccess().getValueINTNUMBERParserRuleCall_1_0(), semanticObject.getValue());
  feeder.finish();
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

private String getVariableName(ValueReference reference, PatternModelAcceptor<?> acceptor) throws SpecificationBuilderException {
  if (reference instanceof VariableValue)
    return getVariableName(((VariableValue) reference).getValue(), acceptor);
  else if (reference instanceof AggregatedValue)
    return aggregate((AggregatedValue) reference, acceptor);
  else if (reference instanceof FunctionEvaluationValue)
    return eval((FunctionEvaluationValue) reference, acceptor);
  else if (reference instanceof IntValue)
    return acceptor.createConstantVariable(((IntValue) reference).getValue());
  else if (reference instanceof StringValue)
    return acceptor.createConstantVariable(((StringValue) reference).getValue());
  else if (reference instanceof EnumValue) // EMF-specific
    return acceptor.createConstantVariable(((EnumValue) reference).getLiteral().getInstance());
  else if (reference instanceof DoubleValue) {
    return acceptor.createConstantVariable(((DoubleValue) reference).getValue());
  } else if (reference instanceof BoolValue) {
    return acceptor.createConstantVariable(((BoolValue) reference).isValue());
  } else
    throw new SpecificationBuilderException(
        "Unsupported value reference of type {1} from EPackage {2} currently unsupported by pattern builder in pattern {3}.",
        new String[] { reference != null ? reference.eClass().getName() : "(null)",
            reference != null ? reference.eClass().getEPackage().getNsURI() : "(null)",
            pattern.getName() }, "Unsupported value expression", pattern);
}
org.eclipse.incquery.patternlanguage.patternLanguageIntValuegetValue

Javadoc

Returns the value of the 'Value' attribute.

If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here...

Popular methods of IntValue

    Popular in Java

    • Reading from database using SQL prepared statement
    • setContentView (Activity)
    • putExtra (Intent)
    • runOnUiThread (Activity)
    • Socket (java.net)
      Provides a client-side TCP socket.
    • Calendar (java.util)
      Calendar is an abstract base class for converting between a Date object and a set of integer fields
    • AtomicInteger (java.util.concurrent.atomic)
      An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
    • Collectors (java.util.stream)
    • JTable (javax.swing)
    • FileUtils (org.apache.commons.io)
      General file manipulation utilities. Facilities are provided in the following areas: * writing to a
    • 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