Keel 2.1RC2

org.apache.commons.collections
Class DoubleOrderedMap.Node

java.lang.Object
  extended byorg.apache.commons.collections.DoubleOrderedMap.Node
All Implemented Interfaces:
java.util.Map.Entry
Enclosing class:
DoubleOrderedMap

private static final class DoubleOrderedMap.Node
extends java.lang.Object
implements java.util.Map.Entry


Field Summary
private  boolean[] blackColor
           
private  boolean calculatedHashCode
           
private  java.lang.Comparable[] data
           
private  int hashcodeValue
           
private  DoubleOrderedMap.Node[] leftNode
           
private  DoubleOrderedMap.Node[] parentNode
           
private  DoubleOrderedMap.Node[] rightNode
           
 
Constructor Summary
(package private) DoubleOrderedMap.Node(java.lang.Comparable key, java.lang.Comparable value)
          Make a new cell with given key and value, and with null links, and black (true) colors.
 
Method Summary
private  void copyColor(DoubleOrderedMap.Node node, int index)
          make this node the same color as another
 boolean equals(java.lang.Object o)
          Compares the specified object with this entry for equality.
private  java.lang.Comparable getData(int index)
          get the specified data
 java.lang.Object getKey()
           
private  DoubleOrderedMap.Node getLeft(int index)
          get the left node
private  DoubleOrderedMap.Node getParent(int index)
          get the parent node
private  DoubleOrderedMap.Node getRight(int index)
          get the right node
 java.lang.Object getValue()
           
 int hashCode()
           
private  boolean isBlack(int index)
          is this node black?
private  boolean isRed(int index)
          is this node red?
private  void setBlack(int index)
          make this node black
private  void setLeft(DoubleOrderedMap.Node node, int index)
          Set this node's left node
private  void setParent(DoubleOrderedMap.Node node, int index)
          Set this node's parent node
private  void setRed(int index)
          make this node red
private  void setRight(DoubleOrderedMap.Node node, int index)
          Set this node's right node
 java.lang.Object setValue(java.lang.Object ignored)
          Optional operation that is not permitted in this implementation
private  void swapColors(DoubleOrderedMap.Node node, int index)
          exchange colors with another node
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private java.lang.Comparable[] data

leftNode

private DoubleOrderedMap.Node[] leftNode

rightNode

private DoubleOrderedMap.Node[] rightNode

parentNode

private DoubleOrderedMap.Node[] parentNode

blackColor

private boolean[] blackColor

hashcodeValue

private int hashcodeValue

calculatedHashCode

private boolean calculatedHashCode
Constructor Detail

DoubleOrderedMap.Node

DoubleOrderedMap.Node(java.lang.Comparable key,
                      java.lang.Comparable value)
Make a new cell with given key and value, and with null links, and black (true) colors.

Parameters:
key -
value -
Method Detail

getData

private java.lang.Comparable getData(int index)
get the specified data

Parameters:
index - KEY or VALUE
Returns:
the key or value

setLeft

private void setLeft(DoubleOrderedMap.Node node,
                     int index)
Set this node's left node

Parameters:
node - the new left node
index - KEY or VALUE

getLeft

private DoubleOrderedMap.Node getLeft(int index)
get the left node

Parameters:
index - KEY or VALUE
Returns:
the left node -- may be null

setRight

private void setRight(DoubleOrderedMap.Node node,
                      int index)
Set this node's right node

Parameters:
node - the new right node
index - KEY or VALUE

getRight

private DoubleOrderedMap.Node getRight(int index)
get the right node

Parameters:
index - KEY or VALUE
Returns:
the right node -- may be null

setParent

private void setParent(DoubleOrderedMap.Node node,
                       int index)
Set this node's parent node

Parameters:
node - the new parent node
index - KEY or VALUE

getParent

private DoubleOrderedMap.Node getParent(int index)
get the parent node

Parameters:
index - KEY or VALUE
Returns:
the parent node -- may be null

swapColors

private void swapColors(DoubleOrderedMap.Node node,
                        int index)
exchange colors with another node

Parameters:
node - the node to swap with
index - KEY or VALUE

isBlack

private boolean isBlack(int index)
is this node black?

Parameters:
index - KEY or VALUE
Returns:
true if black (which is represented as a true boolean)

isRed

private boolean isRed(int index)
is this node red?

Parameters:
index - KEY or VALUE
Returns:
true if non-black

setBlack

private void setBlack(int index)
make this node black

Parameters:
index - KEY or VALUE

setRed

private void setRed(int index)
make this node red

Parameters:
index - KEY or VALUE

copyColor

private void copyColor(DoubleOrderedMap.Node node,
                       int index)
make this node the same color as another

Parameters:
node - the node whose color we're adopting
index - KEY or VALUE

getKey

public java.lang.Object getKey()
Specified by:
getKey in interface java.util.Map.Entry
Returns:
the key corresponding to this entry.

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface java.util.Map.Entry
Returns:
the value corresponding to this entry.

setValue

public java.lang.Object setValue(java.lang.Object ignored)
                          throws java.lang.UnsupportedOperationException
Optional operation that is not permitted in this implementation

Specified by:
setValue in interface java.util.Map.Entry
Parameters:
ignored -
Returns:
does not return
Throws:
java.lang.UnsupportedOperationException

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping.

Specified by:
equals in interface java.util.Map.Entry
Parameters:
o - object to be compared for equality with this map entry.
Returns:
true if the specified object is equal to this map entry.

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map.Entry
Returns:
the hash code value for this map entry.

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.