AXL RADIUS Server API V3

com.theorem.radserver3.radutil
Class IntMap

Object
  extended byIntMap
All Implemented Interfaces:
Map

public class IntMap
extends Object
implements Map

Class to map primitive integers (int) to objects.


Nested Class Summary
 
Nested classes inherited from class Map
Map.Entry
 
Constructor Summary
IntMap()
          Default constructor.
IntMap(int initialCapacity)
          Constructor to set the initial capacity.
 
Method Summary
 void clear()
          Clear the table.
 void clear(int initialCapacity)
          Clear the table and recreate it with a new initial capacity.
 boolean containsKey(int key)
          Returns true if the table contains the key.
 boolean containsKey(Object key)
          Returns true if the table contains the key.
 boolean containsValue(Object value)
          Returns true if this map maps one or more keys to the specified value.
 Set entrySet()
          Get the set of values.
 Object get(int key)
          Get a value given the key.
 Object get(Object key)
          Get a value given the key.
 boolean isEmpty()
          Returns true if the tableis empty.
 Iterator keyIterator()
          Return an iteration of keys.
 Set keySet()
          Get the Set of keys.
static void main(String[] arg)
           
 Object put(int key, Object value)
          Put a key / value pair into the map.
 Object put(Object key, Object value)
          Put a key / value pair into the map.
 void putAll(Map m)
          Put a Map into the table.
 Object remove(int key)
          Remove a key / value from the table.
 Object remove(Object key)
          Remove a key / value from the table.
 int size()
          Return the number of elements in the table.
 String toString()
           
 Collection values()
          Get the values in the map as a Collection
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Map
equals, hashCode
 

Constructor Detail

IntMap

public IntMap()
Default constructor.


IntMap

public IntMap(int initialCapacity)
Constructor to set the initial capacity.

Parameters:
initialCapacity - Initial capacity of the map.
Method Detail

clear

public void clear()
Clear the table.

Specified by:
clear in interface Map

clear

public void clear(int initialCapacity)
Clear the table and recreate it with a new initial capacity.

Parameters:
initialCapacity - New initial capacity.

containsKey

public boolean containsKey(int key)
Returns true if the table contains the key.

Parameters:
key - Key.
Returns:
Object or null if there is no object associated with the key.

containsKey

public boolean containsKey(Object key)
Returns true if the table contains the key.

Specified by:
containsKey in interface Map
Parameters:
key - Key Object (always in Integer).
Returns:
Object or null if there is no object associated with the key.

containsValue

public boolean containsValue(Object value)
Returns true if this map maps one or more keys to the specified value. Not implemented, always return false.

Specified by:
containsValue in interface Map
Parameters:
value - Value.
Returns:
true if the map contains this value.

entrySet

public Set entrySet()
Get the set of values.

Specified by:
entrySet in interface Map
Returns:
Set of values.

get

public Object get(int key)
Get a value given the key.

Parameters:
key - Key.
Returns:
Object or null if there is not object associated with the key.

get

public Object get(Object key)
Get a value given the key.

Specified by:
get in interface Map
Parameters:
key - Key object (always an Integer).
Returns:
Object or null if there is not object associated with the key.

isEmpty

public boolean isEmpty()
Returns true if the tableis empty.

Specified by:
isEmpty in interface Map
Returns:
true if the table is empty.

keyIterator

public Iterator keyIterator()
Return an iteration of keys.


keySet

public Set keySet()
Get the Set of keys.

Specified by:
keySet in interface Map
Returns:
set of keys. This is a set containing Integers.

main

public static void main(String[] arg)

put

public Object put(int key,
                  Object value)
Put a key / value pair into the map.

Parameters:
key - Key.
value - Value.
Returns:
Previous value for this key or null if there was none.

put

public Object put(Object key,
                  Object value)
Put a key / value pair into the map.

Specified by:
put in interface Map
Parameters:
key - Key (of type Integer).
value - Value.
Returns:
Previous value for this key or null if there was none.

putAll

public void putAll(Map m)
Put a Map into the table. The keys must be Integers.

Specified by:
putAll in interface Map
Parameters:
m - Map to add to table.

remove

public Object remove(int key)
Remove a key / value from the table.

Parameters:
key - Key to remove.
Returns:
false.

remove

public Object remove(Object key)
Remove a key / value from the table.

Specified by:
remove in interface Map
Parameters:
key - Key to remove.
Returns:
false.

size

public int size()
Return the number of elements in the table.

Specified by:
size in interface Map
Returns:
number of elements.

toString

public String toString()

values

public Collection values()
Get the values in the map as a Collection

Specified by:
values in interface Map
Returns:
Collection of values.

AXL RADIUS Server API V3

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.