Examples of integerValue()


Examples of org.apache.isis.core.progmodel.facets.value.integer.IntegerValueFacet.integerValue()

    public static double doubleValue(final ObjectAssociation field, final ObjectAdapter value) {
        final ObjectSpecification specification = value.getSpecification();

        final IntegerValueFacet intValueFacet = specification.getFacet(IntegerValueFacet.class);
        if (intValueFacet != null) {
            return intValueFacet.integerValue(value).doubleValue();
        }

        final DoubleFloatingPointValueFacet doubleValueFacet =
            specification.getFacet(DoubleFloatingPointValueFacet.class);
        if (doubleValueFacet != null) {
View Full Code Here

Examples of org.eclipse.uml2.uml.ValueSpecification.integerValue()

    when(slot.getValues()).thenReturn(valueSpecifications);
    when(valueSpecifications.iterator()).thenReturn(valueSpecificationIter);
    when(valueSpecificationIter.hasNext()).thenReturn(true).thenReturn(
        false);
    when(valueSpecificationIter.next()).thenReturn(valueSpecification);
    when(valueSpecification.integerValue()).thenReturn(0);

    enumGenerator.generateConstants(enumeration, ast, ed);

    assertEquals("public enum Company {HOME(0)}\n", ed.toString());
  }
View Full Code Here

Examples of org.eclipse.uml2.uml.ValueSpecification.integerValue()

    when(slot.getValues()).thenReturn(valueSpecifications);
    when(valueSpecifications.iterator()).thenReturn(valueSpecificationIter);
    when(valueSpecificationIter.hasNext()).thenReturn(true).thenReturn(
        false);
    when(valueSpecificationIter.next()).thenReturn(valueSpecification);
    when(valueSpecification.integerValue()).thenReturn(1);

    enumGenerator.generateConstants(enumeration, ast, ed);

    assertEquals("public enum Company {HOME(1L)}\n", ed.toString());
  }
View Full Code Here

Examples of org.eclipse.uml2.uml.ValueSpecification.integerValue()

      if (vs.getType() == null) {
        return vs.stringValue();
      } else if (vs.getType().getName().equals("String")) {
        return vs.stringValue();
      } else if (vs.getType().getName().equals("Integer")) {
        return vs.integerValue() + "";
      } else if (vs.getType().getName().equals("Boolean")) {
        return vs.booleanValue() + "";
      }
      return vs.stringValue();
    }
View Full Code Here

Examples of org.openrdf.model.Literal.integerValue()

            else if (datatype.equals(XMLSchema.DECIMAL)) {
              BigDecimal decimalValue = literal.decimalValue();
              booleanValue = !decimalValue.equals(BigDecimal.ZERO);
            }
            else if (datatype.equals(XMLSchema.INTEGER)) {
              BigInteger integerValue = literal.integerValue();
              booleanValue = !integerValue.equals(BigInteger.ZERO);
            }
            else if (XMLDatatypeUtil.isIntegerDatatype(datatype)) {
              booleanValue = literal.longValue() != 0L;
            }
View Full Code Here

Examples of org.openrdf.model.Literal.integerValue()

                } else if (type.equals(XMLSchema.LONG)) {
                    return l.longValue();
                } else if (type.equals(XMLSchema.INT)) {
                    return l.intValue();
                } else if (type.equals(XMLSchema.INTEGER)) {
                    return l.integerValue();
                } else if (type.equals(XMLSchema.BYTE)) {
                    return l.byteValue();
                } else if (type.equals(XMLSchema.BOOLEAN)) {
                    return l.booleanValue();
                } else if (type.equals(XMLSchema.SHORT)) {
View Full Code Here

Examples of org.openrdf.model.Literal.integerValue()

        else if (XMLDatatypeUtil.isNumericDatatype(datatype)) {
          // FIXME: decimals, floats and doubles must be processed
          // separately, see
          // http://www.w3.org/TR/xpath-functions/#casting-from-primitive-to-primitive
          try {
            BigInteger integerValue = literal.integerValue();
            return valueFactory.createLiteral(integerValue.toString(), XMLSchema.INTEGER);
          }
          catch (NumberFormatException e) {
            throw new ValueExprEvaluationException(e.getMessage(), e);
          }
View Full Code Here

Examples of org.openrdf.model.Literal.integerValue()

            else if (datatype.equals(XMLSchema.DECIMAL)) {
              BigDecimal decimalValue = literal.decimalValue();
              booleanValue = !decimalValue.equals(BigDecimal.ZERO);
            }
            else if (datatype.equals(XMLSchema.INTEGER)) {
              BigInteger integerValue = literal.integerValue();
              booleanValue = !integerValue.equals(BigInteger.ZERO);
            }
            else if (XMLDatatypeUtil.isIntegerDatatype(datatype)) {
              booleanValue = literal.longValue() != 0L;
            }
View Full Code Here

Examples of org.openrdf.model.Literal.integerValue()

            if (null == datatype) {
                return l.getLabel();
            } else if (XMLSchema.STRING.equals(datatype)) {
                return l.getLabel();
            } else if (XMLSchema.INTEGER.equals(datatype)) {
                return l.integerValue();
            } else if (XMLSchema.INT.equals(datatype)) {
                return l.intValue();
            } else if (XMLSchema.ANYURI.equals(datatype)) {
                try {
                    return new java.net.URI(l.getLabel());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.