Search this API

y.util
Class Cursors

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

public final class Cursors
extends Object

This class contains only static methods, that can be used in conjunction with objects of type YCursor and Iterator.


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(Collection c)
          Creates a YCursor view of the given collection.
static Iterator createIterator(YCursor cursor)
          Creates a first-to-last Iterator view of the given cursor.
static Iterator createReverseIterator(YCursor cursor)
          Creates a last-to-first Iterator view of the given cursor.
static Object[] toArray(YCursor cursor, 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 Object[] toArray(YCursor cursor,
                               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(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.

createIterator

public static 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 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-2013,
yWorks GmbH.
All rights reserved.