Examples of startNode()


Examples of com.thoughtworks.xstream.io.StatefulWriter.startNode()

     * @since 1.0.3
     */
    public ObjectOutputStream createObjectOutputStream(
            final HierarchicalStreamWriter writer, String rootNodeName) throws IOException {
        final StatefulWriter statefulWriter = new StatefulWriter(writer);
        statefulWriter.startNode(rootNodeName, null);
        return new CustomObjectOutputStream(new CustomObjectOutputStream.StreamCallback() {
            public void writeToStream(Object object) {
                marshal(object, statefulWriter);
            }

View Full Code Here

Examples of com.thoughtworks.xstream.io.StatefulWriter.startNode()

     * @since 1.0.3
     */
    public ObjectOutputStream createObjectOutputStream(
            final HierarchicalStreamWriter writer, String rootNodeName) throws IOException {
        final StatefulWriter statefulWriter = new StatefulWriter(writer);
        statefulWriter.startNode(rootNodeName, null);
        return new CustomObjectOutputStream(new CustomObjectOutputStream.StreamCallback() {
            public void writeToStream(Object object) {
                marshal(object, statefulWriter);
            }

View Full Code Here

Examples of com.thoughtworks.xstream.io.xml.PrettyPrintWriter.startNode()

        xstream.alias("person", Person.class);
        StringWriter buffer = new StringWriter();

        // serialize
        HierarchicalStreamWriter writer = new PrettyPrintWriter(buffer);
        writer.startNode("people");
        xstream.marshal(new Person("Postman", "Pat"), writer);
        xstream.marshal(new Person("Bob", "Builder"), writer);
        xstream.marshal(new Person("Tinky", "Winky"), writer);
        writer.endNode();
View Full Code Here

Examples of org.neo4j.graphdb.Path.startNode()

        Map<String, Object> pathData = MapUtil.map("start", node, "nodes",Collections.singletonList(node),"length", 0, "relationships", Collections.EMPTY_LIST, "end", node);
        System.out.println("pathData = " + pathData);
        Path path = RestPathParser.parse(pathData, restApi);
        assertEquals(0,path.length());
        assertEquals(null,path.lastRelationship());
        assertEquals(0,path.startNode().getId());
        assertEquals(0,path.endNode().getId());
    }
    @Test
    public void testParsePath() throws Exception {
        RestAPI restApi = new RestAPIImpl(URI);
View Full Code Here

Examples of org.neo4j.graphdb.Path.startNode()

        Map<String, Object> pathData = MapUtil.map("start", node, "nodes", Arrays.asList(node, node2),"length", 1, "relationships", Collections.singletonList(relationship), "end", node2);
        System.out.println("pathData = " + pathData);
        Path path = RestPathParser.parse(pathData, restApi);
        assertEquals(1,path.length());
        assertEquals(1,path.lastRelationship().getId());
        assertEquals(0,path.startNode().getId());
        assertEquals(1,path.endNode().getId());
    }

    private Map<String, Object> node(int id) {
        return MapUtil.map("data", Collections.EMPTY_MAP, "self", nodeUrl(id));
View Full Code Here

Examples of org.neo4j.graphdb.Path.startNode()

        path.put("relationships", asList(relationship1));
        path.put("end", node2);
        Path result = (Path)converter.convertToResultType(path, new TypeInformation(Path.class));

        assertEquals(SimplePath.class, result.getClass());
        assertEquals(1, result.startNode().getId());
        assertEquals(2, result.endNode().getId());
        assertEquals(1, result.lastRelationship().getId());
    }

View Full Code Here

Examples of org.neo4j.graphdb.Path.startNode()

            return true;
        }
        else if ( obj instanceof Path )
        {
            Path other = (Path) obj;
            if ( !start.equals( other.startNode() ) )
            {
                return false;
            }

            Iterator<Relationship> thisPathIterator =
View Full Code Here

Examples of org.neo4j.graphdb.Path.startNode()

                Traversal.expanderForTypes( ExampleTypes.MY_TYPE, Direction.OUTGOING ), 15 );
        Iterable<Path> paths = finder.findAllPaths( startNode, endNode );
        // END SNIPPET: shortestPathUsage
        Path path = paths.iterator().next();
        assertEquals( 2, path.length() );
        assertEquals( startNode, path.startNode() );
        assertEquals( endNode, path.endNode() );
        Iterator<Node> iterator = path.nodes().iterator();
        iterator.next();
        assertEquals( middleNode1, iterator.next() );
    }
View Full Code Here

Examples of org.neo4j.graphdb.Path.startNode()

                   && relationships.equals( other.relationships );
        }
        else if ( obj instanceof Path )
        {
            Path other = (Path) obj;
            if ( startNode().equals( other.startNode() ) )
            {
                Iterator<Relationship> these = relationships().iterator();
                Iterator<Relationship> those = other.relationships().iterator();
                while ( these.hasNext() && those.hasNext() )
                {
View Full Code Here

Examples of org.springframework.data.neo4j.support.path.NodePath.startNode()

        Node node = getNodeState(michael);
        NodePath path = new NodePath(node);
        EntityPath<Person, Person> entityPath = new ConvertingEntityPath<Person, Person>(path, neo4jTemplate);

        Assert.assertEquals("start entity",michael, entityPath.startEntity());
        Assert.assertEquals("start node",node, path.startNode());
        Assert.assertEquals("end entity",michael, entityPath.endEntity());
        Assert.assertEquals("end node",node, path.endNode());
        Assert.assertNull("no relationship", entityPath.lastRelationshipEntity());
        Assert.assertNull("no relationship", path.lastRelationship());
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.