NetKernel APIs


com.ten60.netkernel.util
Class PairList

java.lang.Object
  extended bycom.ten60.netkernel.util.PairList

public final class PairList
extends Object

A low memory implementation of a pair list when you want a map to link two values together but don't need to look them up. Keys and values are stored alternately in an array list.


Constructor Summary
PairList(int aSize)
          Creates a new instance of PairList
 
Method Summary
 boolean contains(Object aValue1, Object aValue2)
          returns true if the values are in the collection
 Object getValue1(int aIndex)
          return the key value at the given index
 Object getValue2(int aIndex)
          return the value value at the given index
 void put(Object aValue1, Object aValue2)
          put a new key value pair in the collection
 int size()
          return the number of pairs in the collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairList

public PairList(int aSize)
Creates a new instance of PairList

Method Detail

put

public void put(Object aValue1,
                Object aValue2)
put a new key value pair in the collection


size

public int size()
return the number of pairs in the collection


getValue1

public Object getValue1(int aIndex)
return the key value at the given index


getValue2

public Object getValue2(int aIndex)
return the value value at the given index


contains

public boolean contains(Object aValue1,
                        Object aValue2)
returns true if the values are in the collection


NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.