com.inxar.syntacs.util
Class ArrayIntFunction

java.lang.Object
  |
  +--com.inxar.syntacs.util.ArrayIntFunction
All Implemented Interfaces:
IntFunction

public class ArrayIntFunction
extends Object
implements IntFunction

Concrete implementation of IntFunction which uses an array internally to store values and an IntSet to track keys.


Constructor Summary
ArrayIntFunction(int capacity)
          Constructs a new ArrayIntFunction.
 
Method Summary
 Object clone()
           
 int get(int key)
          Returns the value mapped to the given key.
 IntSet keys()
          Returns an IntSet view of the keys.
 void put(int key, int value)
          Sets the given value to the given key.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayIntFunction

public ArrayIntFunction(int capacity)
Constructs a new ArrayIntFunction.
Method Detail

put

public void put(int key,
                int value)
Description copied from interface: IntFunction
Sets the given value to the given key.
Specified by:
put in interface IntFunction

get

public int get(int key)
Description copied from interface: IntFunction
Returns the value mapped to the given key.
Specified by:
get in interface IntFunction

keys

public IntSet keys()
Description copied from interface: IntFunction
Returns an IntSet view of the keys.
Specified by:
keys in interface IntFunction

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException