Search this API

y.util
Class Cursors

java.lang.Object
  extended by y.util.Cursors

public final class Cursors
extends java.lang.Object

Provides utility methods for working with cursors and iterators.

 

Method Summary
static YCursor concatenate(YCursor c1, YCursor c2)
          Creates a new cursor that provides a logical view on the concatenation of the two given cursors.
static YCursor createCursor(java.util.Collection c)
          Creates a YCursor view of the given collection.
static EdgeCursor createEdgeCursor(java.util.Collection c)
          Creates a cursor view of the given collection.
static java.util.Iterator createIterator(YCursor cursor)
          Creates a first-to-last Iterator view of the given cursor.
static NodeCursor createNodeCursor(java.util.Collection c)
          Creates a cursor view of the given collection.
static java.util.Iterator createReverseIterator(YCursor cursor)
          Creates a last-to-first Iterator view of the given cursor.
static java.lang.Object[] toArray(YCursor cursor, java.lang.Object[] dest)
          Creates or fills an array with the values provided by the cursor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toArray

public static java.lang.Object[] toArray(YCursor cursor,
                                         java.lang.Object[] dest)
Creates or fills an array with the values provided by the cursor

Parameters:
cursor - the cursor
dest - the array to fill with the values or null if the method should create the array itself
Returns:
dest or a newly created array filled with the values from cursor

createCursor

public static YCursor createCursor(java.util.Collection c)
Creates a YCursor view of the given collection.

Note that the returned cursor does not support the prev and toLast operations.

Parameters:
c - The collection.
Returns:
The cursor view of the given collection.
See Also:
createEdgeCursor(java.util.Collection), createNodeCursor(java.util.Collection)

createEdgeCursor

public static EdgeCursor createEdgeCursor(java.util.Collection c)
Creates a cursor view of the given collection.

Note that the returned cursor does not support the operations prev, toLast, and EdgeCursor.cyclicPrev().

Parameters:
c - The collection.
Returns:
an EdgeCursor view of the given collection.
See Also:
createNodeCursor(java.util.Collection)

createNodeCursor

public static NodeCursor createNodeCursor(java.util.Collection c)
Creates a cursor view of the given collection.

Note that the returned cursor does not support the operations prev, toLast, and NodeCursor.cyclicPrev().

Parameters:
c - The collection.
Returns:
an NodeCursor view of the given collection.
See Also:
createEdgeCursor(java.util.Collection)

createIterator

public static java.util.Iterator createIterator(YCursor cursor)
Creates a first-to-last Iterator view of the given cursor.

Note that the returned iterator does not support the remove operation.

Parameters:
cursor - The cursor.
Returns:
The iterator view of the given cursor.

createReverseIterator

public static java.util.Iterator createReverseIterator(YCursor cursor)
Creates a last-to-first Iterator view of the given cursor.

Note that the returned iterator does not support the remove operation.

Parameters:
cursor - The cursor.
Returns:
The iterator view of the given cursor.

concatenate

public static YCursor concatenate(YCursor c1,
                                  YCursor c2)
Creates a new cursor that provides a logical view on the concatenation of the two given cursors.

Parameters:
c1 - - first concatenation argument
c2 - - second concatenation argument

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.