mdh.hephaestus2.containers
Class KeyValue

java.lang.Object
  |
  +--mdh.hephaestus2.containers.KeyValue
All Implemented Interfaces:
Serializable

public final class KeyValue
extends Object
implements Serializable

KeyValue stores, as the name might possibly suggest, a key and a value. KV's are generated by SparseArrays, and often used internally by this package. The contents are immutable outside the package, and you can use the accessors next(), key(), and value() to get at the fields safely.

Yes, you have to iterate through the linked list yourself, with code like:

 KeyValue kv = hash.list();
 while(kv != null)
 {
     System.out.println( "["+kv.key()+"] " + kv.value() );
     kv = kv.next();
 }
 

Author:
Copyright © 1998 by Mark Hughes <kamikaze@kuoi.asui.uidaho.edu>
See Also:
Serialized Form

Constructor Summary
KeyValue()
           
KeyValue(int k, Object v)
           
KeyValue(KeyValue clone)
           
 
Method Summary
 int key()
           
 KeyValue next()
          Accessors
 String toString()
           
 Object value()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyValue

public KeyValue()

KeyValue

public KeyValue(int k,
                Object v)

KeyValue

public KeyValue(KeyValue clone)
Method Detail

key

public final int key()

next

public final KeyValue next()
Accessors


toString

public String toString()
Overrides:
toString in class Object

value

public final Object value()