Top Description Inners Fields Constructors Methods
org.xnio

pack-priv final Class ObjectProperties

extends Hashtable<String, String>
Class Inheritance
Imports
java.util.Collection, .Collections, .Enumeration, .Hashtable, .LinkedHashMap, .Map, .Set

A Hashtable variant which keeps property names in order, for use by MBean ObjectNames.
Author
David M. Lloyd

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ObjectProperties.Property

A single property in a properties list.

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
private static final long

Constructor Summary

AccessConstructor and Description
public
ObjectProperties(final int initialCapacity, final float loadFactor)

public
ObjectProperties(final int initialCapacity)

public
public
ObjectProperties(final Map<? extends String, ? extends String> t)

public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.Hashtable.clear.

Implements java.util.Map.clear.

Clears this hashtable so that it contains no keys.

public Object
clone()

Overrides java.util.Hashtable.clone.

Creates a shallow copy of this hashtable.

public boolean
contains(final Object
a value to search for
value
)

Overrides java.util.Hashtable.contains.

Tests if some key maps into the specified value in this hashtable.

public boolean
containsKey(final Object
possible key
key
)

Overrides java.util.Hashtable.containsKey.

Implements java.util.Map.containsKey.

Tests if the specified object is a key in this hashtable.

public boolean
containsValue(final Object
value whose presence in this hashtable is to be tested
value
)

Overrides java.util.Hashtable.containsValue.

Implements java.util.Map.containsValue.

Returns true if this hashtable maps one or more keys to this value.

public Enumeration<String>
elements()

Overrides java.util.Hashtable.elements.

Returns an enumeration of the values in this hashtable.

public Set<Map.Entry<String, String>>
entrySet()

Overrides java.util.Hashtable.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public String
get(final Object
the key whose associated value is to be returned
key
)

Overrides java.util.Hashtable.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public boolean
isEmpty()

Overrides java.util.Hashtable.isEmpty.

Implements java.util.Map.isEmpty.

Tests if this hashtable maps no keys to values.

public Enumeration<String>
keys()

Overrides java.util.Hashtable.keys.

Returns an enumeration of the keys in this hashtable.

public Set<String>
keySet()

Overrides java.util.Hashtable.keySet.

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

public static ObjectProperties
public static ObjectProperties.Property
property(String key, String value)

public String
put(final String
the hashtable key
key
,
final String
the value
value
)

Overrides java.util.Hashtable.put.

Implements java.util.Map.put.

Maps the specified key to the specified value in this hashtable.

public void
putAll(final Map<? extends String, ? extends String>
mappings to be stored in this map
t
)

Overrides java.util.Hashtable.putAll.

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this hashtable.

protected void
rehash()

Overrides java.util.Hashtable.rehash.

Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.

public String
remove(final Object
the key that needs to be removed
key
)

Overrides java.util.Hashtable.remove.

Implements java.util.Map.remove.

Removes the key (and its corresponding value) from this hashtable.

public int
size()

Overrides java.util.Hashtable.size.

Implements java.util.Map.size.

Returns the number of keys in this hashtable.

public String
toString()

Overrides java.util.Hashtable.toString.

Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters " , " (comma and space).

public Collection<String>
values()

Overrides java.util.Hashtable.values.

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.

Inherited from java.util.Hashtable:
computecomputeIfAbsentcomputeIfPresentequalsforEachgetOrDefaulthashCodemergeputIfAbsentremovereplacereplacereplaceAll

Field Detail

realMapback to summary
private final Map<String, String> realMap
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.Hashtable.serialVersionUID.

Constructor Detail

ObjectPropertiesback to summary
public ObjectProperties(final int initialCapacity, final float loadFactor)
ObjectPropertiesback to summary
public ObjectProperties(final int initialCapacity)
ObjectPropertiesback to summary
public ObjectProperties()
ObjectPropertiesback to summary
public ObjectProperties(final Map<? extends String, ? extends String> t)
ObjectPropertiesback to summary
public ObjectProperties(ObjectProperties.Property... properties)

Method Detail

clearback to summary
public void clear()

Overrides java.util.Hashtable.clear.

Implements java.util.Map.clear.

Doc from java.util.Hashtable.clear.

Clears this hashtable so that it contains no keys.

cloneback to summary
public Object clone()

Overrides java.util.Hashtable.clone.

Doc from java.util.Hashtable.clone.

Creates a shallow copy of this hashtable. All the structure of the hashtable itself is copied, but the keys and values are not cloned. This is a relatively expensive operation.

Returns:Object

a clone of the hashtable

containsback to summary
public boolean contains(final Object value)

Overrides java.util.Hashtable.contains.

Doc from java.util.Hashtable.contains.

Tests if some key maps into the specified value in this hashtable. This operation is more expensive than the containsKey method.

Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).

Parameters
value:Object

a value to search for

Returns:boolean

true if and only if some key maps to the value argument in this hashtable as determined by the equals method; false otherwise.

containsKeyback to summary
public boolean containsKey(final Object key)

Overrides java.util.Hashtable.containsKey.

Implements java.util.Map.containsKey.

Doc from java.util.Hashtable.containsKey.

Tests if the specified object is a key in this hashtable.

Parameters
key:Object

possible key

Returns:boolean

true if and only if the specified object is a key in this hashtable, as determined by the equals method; false otherwise.

containsValueback to summary
public boolean containsValue(final Object value)

Overrides java.util.Hashtable.containsValue.

Implements java.util.Map.containsValue.

Doc from java.util.Hashtable.containsValue.

Returns true if this hashtable maps one or more keys to this value.

Note that this method is identical in functionality to contains (which predates the Map interface).

Parameters
value:Object

value whose presence in this hashtable is to be tested

Returns:boolean

true if this map maps one or more keys to the specified value

elementsback to summary
public Enumeration<String> elements()

Overrides java.util.Hashtable.elements.

Doc from java.util.Hashtable.elements.

Returns an enumeration of the values in this hashtable. Use the Enumeration methods on the returned object to fetch the elements sequentially. If the hashtable is structurally modified while enumerating over the values then the results of enumerating are undefined.

Returns:Enumeration<String>

an enumeration of the values in this hashtable.

entrySetback to summary
public Set<Map.Entry<String, String>> entrySet()

Overrides java.util.Hashtable.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.Hashtable.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<Map.Entry<String, String>>

Doc from java.util.Map.entrySet.

a set view of the mappings contained in this map

getback to summary
public String get(final Object key)

Overrides java.util.Hashtable.get.

Implements java.util.Map.get.

Doc from java.util.Hashtable.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that (key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

Parameters
key:Object

the key whose associated value is to be returned

Returns:String

the value to which the specified key is mapped, or null if this map contains no mapping for the key

isEmptyback to summary
public boolean isEmpty()

Overrides java.util.Hashtable.isEmpty.

Implements java.util.Map.isEmpty.

Doc from java.util.Hashtable.isEmpty.

Tests if this hashtable maps no keys to values.

Returns:boolean

true if this hashtable maps no keys to values; false otherwise.

keysback to summary
public Enumeration<String> keys()

Overrides java.util.Hashtable.keys.

Doc from java.util.Hashtable.keys.

Returns an enumeration of the keys in this hashtable. Use the Enumeration methods on the returned object to fetch the keys sequentially. If the hashtable is structurally modified while enumerating over the keys then the results of enumerating are undefined.

Returns:Enumeration<String>

an enumeration of the keys in this hashtable.

keySetback to summary
public Set<String> keySet()

Overrides java.util.Hashtable.keySet.

Implements java.util.Map.keySet.

Doc from java.util.Hashtable.keySet.

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:Set<String>

Doc from java.util.Map.keySet.

a set view of the keys contained in this map

propertiesback to summary
public static ObjectProperties properties(ObjectProperties.Property... properties)
propertyback to summary
public static ObjectProperties.Property property(String key, String value)
putback to summary
public String put(final String key, final String value)

Overrides java.util.Hashtable.put.

Implements java.util.Map.put.

Doc from java.util.Hashtable.put.

Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters
key:String

the hashtable key

value:String

the value

Returns:String

the previous value of the specified key in this hashtable, or null if it did not have one

putAllback to summary
public void putAll(final Map<? extends String, ? extends String> t)

Overrides java.util.Hashtable.putAll.

Implements java.util.Map.putAll.

Doc from java.util.Hashtable.putAll.

Copies all of the mappings from the specified map to this hashtable. These mappings will replace any mappings that this hashtable had for any of the keys currently in the specified map.

Parameters
t:Map<? extends String, ? extends String>

mappings to be stored in this map

rehashback to summary
protected void rehash()

Overrides java.util.Hashtable.rehash.

Doc from java.util.Hashtable.rehash.

Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. This method is called automatically when the number of keys in the hashtable exceeds this hashtable's capacity and load factor.

removeback to summary
public String remove(final Object key)

Overrides java.util.Hashtable.remove.

Implements java.util.Map.remove.

Doc from java.util.Hashtable.remove.

Removes the key (and its corresponding value) from this hashtable. This method does nothing if the key is not in the hashtable.

Parameters
key:Object

the key that needs to be removed

Returns:String

the value to which the key had been mapped in this hashtable, or null if the key did not have a mapping

sizeback to summary
public int size()

Overrides java.util.Hashtable.size.

Implements java.util.Map.size.

Doc from java.util.Hashtable.size.

Returns the number of keys in this hashtable.

Returns:int

the number of keys in this hashtable.

toStringback to summary
public String toString()

Overrides java.util.Hashtable.toString.

Doc from java.util.Hashtable.toString.

Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters " , " (comma and space). Each entry is rendered as the key, an equals sign =, and the associated element, where the toString method is used to convert the key and element to strings.

Returns:String

a string representation of this hashtable

valuesback to summary
public Collection<String> values()

Overrides java.util.Hashtable.values.

Implements java.util.Map.values.

Doc from java.util.Hashtable.values.

Returns a Collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Collection<String>

Doc from java.util.Map.values.

a collection view of the values contained in this map

org.xnio back to summary

public final Class ObjectProperties.Property

extends Object
Class Inheritance

A single property in a properties list.

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
Property(final String key, final String value)

Method Summary

Modifier and TypeMethod and Description
public String
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private final String key
valueback to summary
private final String value

Constructor Detail

Propertyback to summary
public Property(final String key, final String value)

Method Detail

getKeyback to summary
public String getKey()
getValueback to summary
public String getValue()