com.sun.sgs.app.util
Interface ScalableList.Node<E>

Type Parameters:
E - the type of element stored in the ScalableList
All Known Implementing Classes:
ScalableList.ListNode, ScalableList.TreeNode
Enclosing class:
ScalableList<E>

static interface ScalableList.Node<E>

An interface which unifies the concept of a ListNode and TreeNode as elements within a ScalableList. This interface avoids cast warnings when the identity of a given element is not immediately known.


Method Summary
 void clear()
          Walks up the tree and removes the object and any of its parents.
 ScalableList.TreeNode<E> getParent()
          Retrieves the node's parent.
 ScalableList.Node<E> next()
          Returns the next Node in sequence, or null if none exists.
 ScalableList.Node<E> prev()
          Returns the previous Node in sequence, or null if none exists.
 com.sun.sgs.app.util.ScalableList.SearchResult<E> search(int currentValue, int destIndex)
          Traverses the tree (recursively) in search of the ListNode which contains the index provided.
 void setNext(ScalableList.Node<E> next)
          Sets the next element to be the supplied argument.
 void setParent(ScalableList.TreeNode<E> t)
          Sets the Node's parent to the supplied argument.
 void setPrev(ScalableList.Node<E> prev)
          Sets the previous element to be the supplied argument.
 int size()
          The size of the node; that is, the sum of the sizes of its immediate children.
 

Method Detail

getParent

ScalableList.TreeNode<E> getParent()
Retrieves the node's parent.

Returns:
the parent, or null if none exists.

setParent

void setParent(ScalableList.TreeNode<E> t)
Sets the Node's parent to the supplied argument.


size

int size()
The size of the node; that is, the sum of the sizes of its immediate children.

Returns:
the size of this node.

clear

void clear()
Walks up the tree and removes the object and any of its parents. This method is intended to be called during the AsynchronousClearTask operation.


search

com.sun.sgs.app.util.ScalableList.SearchResult<E> search(int currentValue,
                                                         int destIndex)
Traverses the tree (recursively) in search of the ListNode which contains the index provided. If no ListNode can be found, then null is returned.

Parameters:
currentValue - the current index value at the beginning of this current search
destIndex - the absolute index of the desired element
Returns:
the ListNode containing the absolute destIndex
Throws:
IndexOutOfBoundsException - if the index is out of bounds

next

ScalableList.Node<E> next()
Returns the next Node in sequence, or null if none exists.

Returns:
the next node

setNext

void setNext(ScalableList.Node<E> next)
Sets the next element to be the supplied argument. The argument should be the same type as the variable.

Parameters:
next - the next Node

prev

ScalableList.Node<E> prev()
Returns the previous Node in sequence, or null if none exists.

Returns:
the previous node

setPrev

void setPrev(ScalableList.Node<E> prev)
Sets the previous element to be the supplied argument. The argument should be the same type as the variable.

Parameters:
prev - the previous Node

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved