Package org.openrdf.model

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


            else if (datatype.equals(XMLSchema.INTEGER)) {
              BigInteger integerValue = literal.integerValue();
              booleanValue = !integerValue.equals(BigInteger.ZERO);
            }
            else if (XMLDatatypeUtil.isIntegerDatatype(datatype)) {
              booleanValue = literal.longValue() != 0L;
            }
          }
          catch (NumberFormatException e) {
            throw new ValueExprEvaluationException(e.getMessage(), e);
          }
View Full Code Here


                return l.getLabel();
            } else {
                if (type.equals(XMLSchema.STRING)) {
                    return l.stringValue();
                } 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)) {
View Full Code Here

        assertEquals(XMLSchema.INT, l.getDatatype());
        l = vf.createLiteral(42l);
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("42", l.getLabel());
        assertEquals(42l, l.longValue());
        assertEquals(XMLSchema.LONG, l.getDatatype());
        l = vf.createLiteral((short) 42);
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("42", l.getLabel());
View Full Code Here

        l = (Literal) toSet(sc.getStatements(valueUri, hasValueUri, null, false)).iterator().next().getObject();
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("42", l.getLabel());
        assertEquals(XMLSchema.LONG, l.getDatatype());
        assertEquals(42l, l.longValue());
        valueUri = vf.createURI(prefix + "floatValue");
        l = (Literal) toSet(sc.getStatements(valueUri, hasValueUri, null, false)).iterator().next().getObject();
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("3.1415926", l.getLabel());
View Full Code Here

            else if (datatype.equals(XMLSchema.INTEGER)) {
              BigInteger integerValue = literal.integerValue();
              booleanValue = !integerValue.equals(BigInteger.ZERO);
            }
            else if (XMLDatatypeUtil.isIntegerDatatype(datatype)) {
              booleanValue = literal.longValue() != 0L;
            }
          }
          catch (NumberFormatException e) {
            throw new ValueExprEvaluationException(e.getMessage(), e);
          }
View Full Code Here

                    throw new ScriptException(e);
                }
            } else if (XMLSchema.SHORT.equals(datatype)) {
                return l.shortValue();
            } else if (XMLSchema.LONG.equals(datatype)) {
                return l.longValue();
            } else if (XMLSchema.FLOAT.equals(datatype)) {
                return l.floatValue();
            } else if (XMLSchema.BYTE.equals(datatype)) {
                return l.byteValue();
            } else if (XMLSchema.DATETIME.equals(datatype)) {
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.