Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit

ie.ncl.msg
Class Attributes

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable
          extended by ie.ncl.msg.Attributes
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class Attributes
extends java.util.Hashtable
implements java.lang.Cloneable, java.io.Serializable

The Attributes object (or attribute set) is used to group a set of attribute name and value pairs.

Each attribute has a unique name. Its value can be any object type.

An interface defining message attribute names should extend the AttributesName interface.

See Also:
AttributeNames, Serialized Form

Constructor Summary
Attributes()
          Create an empty set of message properties.
Attributes(java.util.Hashtable hashtable)
          Create a set of attributes initilized with the values from the hashtable paramater.
 
Method Summary
 java.lang.Object clone()
          Clone this Attributes object.
 boolean contains(Attributes other)
          Check that this set of attributes contains the 'other' set of attribute AND the values of the other set match this one.
 Attributes copy()
           
 java.lang.Object get(java.lang.String name)
          Get the Object value of an attribute as specified by its unique name.
 boolean getBoolean(java.lang.String name)
          Get the boolean value of an attribute as specified by its unique name.
 java.util.Date getDate(java.lang.String name)
          Get the Date value of an attribute as specified by its unique name.
 int getInt(java.lang.String name)
          Get the int value of an attribute as specified by its unique name.
 java.lang.String getString(java.lang.String name)
          Get the String value of an attribute as specified by its unique name.
 void merge(Attributes other)
          Merge this set of attributes with the 'other' set.
 void put(java.lang.String name, boolean value)
          Add an attribute with a boolean value to the set of attributes.
 void put(java.lang.String name, java.util.Date value)
          Add an attribute with a Date value to the set of attributes.
 void put(java.lang.String name, int value)
          Add an attribute with a int value to the set of attributes.
 void put(java.lang.String name, java.lang.Object value)
          Add an attribute with an Object value to the set of attributes.
 void put(java.lang.String name, java.lang.String value)
          Add an attribute with a String value to the set of attributes.
 java.lang.Object remove(java.lang.String name)
          Remove an Object attribute as specified by its unique name.
 java.lang.String toString()
          This string representation of name/value pairs, each on a new line.
 
Methods inherited from class java.util.Hashtable
clear, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attributes

public Attributes()
Create an empty set of message properties.


Attributes

public Attributes(java.util.Hashtable hashtable)
Create a set of attributes initilized with the values from the hashtable paramater.

Method Detail

put

public void put(java.lang.String name,
                java.lang.String value)
Add an attribute with a String value to the set of attributes. If an attribute already exists, its old value is replaced with the new one.


put

public void put(java.lang.String name,
                java.util.Date value)
Add an attribute with a Date value to the set of attributes. If an attribute already exists, its old value is replaced with the new one.


put

public void put(java.lang.String name,
                int value)
Add an attribute with a int value to the set of attributes. If an attribute already exists, its old value is replaced with the new one.


put

public void put(java.lang.String name,
                boolean value)
Add an attribute with a boolean value to the set of attributes. If an attribute already exists, its old value is replaced with the new one.


put

public void put(java.lang.String name,
                java.lang.Object value)
Add an attribute with an Object value to the set of attributes. If an attribute already exists, its old value is replaced with the new one.


getString

public java.lang.String getString(java.lang.String name)
Get the String value of an attribute as specified by its unique name. A null value is returned if the attribute does not exist. If the attribute value is not a String then a ClassCastException will be thrown.


getDate

public java.util.Date getDate(java.lang.String name)
Get the Date value of an attribute as specified by its unique name. A null value is returned if the attribute does not exist. If the attribute value is not a Date then a ClassCastException will be thrown.


getInt

public int getInt(java.lang.String name)
Get the int value of an attribute as specified by its unique name. A null pointer exception is returned if the attribute does not exist. If the attribute value is not an int (Integer internally) then a ClassCastException will be thrown.


getBoolean

public boolean getBoolean(java.lang.String name)
Get the boolean value of an attribute as specified by its unique name. A null pointer exception is returned if the attribute does not exist. If the attribute value is not a boolean (Boolean internally) then a ClassCastException will be thrown.


get

public java.lang.Object get(java.lang.String name)
Get the Object value of an attribute as specified by its unique name. A null is returned if the attribute does not exist.


remove

public java.lang.Object remove(java.lang.String name)
Remove an Object attribute as specified by its unique name.

Returns:
the attribute Object if it exists, null otherwise

contains

public boolean contains(Attributes other)
Check that this set of attributes contains the 'other' set of attribute AND the values of the other set match this one.

Returns:
true if 'other' Attributes is a subset of these attributes, (including an empty Attributes object).

merge

public void merge(Attributes other)
Merge this set of attributes with the 'other' set. Attributes in this set take precedence over the 'other' set.


toString

public java.lang.String toString()
This string representation of name/value pairs, each on a new line.

Overrides:
toString in class java.util.Hashtable

clone

public java.lang.Object clone()
Clone this Attributes object.

Overrides:
clone in class java.util.Hashtable

copy

public Attributes copy()
Returns:
clone of this Attributes object

Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit