/** * Efficiently serialize a KiWiIntLiteral to a DataOutput destination. * * @param out the destination * @param literal the KiWiIntLiteral to serialize * @throws IOException */ public static void writeIntLiteral(DataOutput out, KiWiIntLiteral literal) throws IOException { if(literal == null) { out.writeLong(-1L); } else { out.writeLong(literal.getId()); out.writeLong(literal.getIntContent()); writeURI(out, literal.getType()); out.writeLong(literal.getCreated().getTime()); } }
/** * Efficiently serialize a KiWiIntLiteral to a DataOutput destination. * * @param out the destination * @param literal the KiWiIntLiteral to serialize * @throws IOException */ public static void writeIntLiteral(DataOutput out, KiWiIntLiteral literal) throws IOException { if(literal == null) { out.writeLong(-1L); } else { out.writeLong(literal.getId()); out.writeLong(literal.getIntContent()); writeURI(out, literal.getType()); out.writeLong(literal.getCreated().getTime()); } }
} else if(n instanceof KiWiIntLiteral) { KiWiIntLiteral l = (KiWiIntLiteral)n; createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDoubleLiteral) { KiWiDoubleLiteral l = (KiWiDoubleLiteral)n;
} else if(n instanceof KiWiIntLiteral) { KiWiIntLiteral l = (KiWiIntLiteral)n; createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDoubleLiteral) { KiWiDoubleLiteral l = (KiWiDoubleLiteral)n;
} else if(n instanceof KiWiIntLiteral) { KiWiIntLiteral l = (KiWiIntLiteral)n; createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDoubleLiteral) { KiWiDoubleLiteral l = (KiWiDoubleLiteral)n;
} else if(n instanceof KiWiIntLiteral) { KiWiIntLiteral l = (KiWiIntLiteral)n; createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDoubleLiteral) { KiWiDoubleLiteral l = (KiWiDoubleLiteral)n;
Assert.assertTrue(literal.getId() >= 0); KiWiNode testLiteral1 = connection.loadNodeById(literal.getId()); KiWiNode testLiteral2 = connection.loadNodeById(literal.getId()); KiWiNode testLiteral4 = connection.loadNodeById(literal.getId()); Assert.assertEquals((long) literal.getId(), result.getLong("id")); Assert.assertEquals(literal.stringValue(),result.getString("svalue")); Assert.assertEquals(value,result.getLong("ivalue"));