Container for message options. More...
Public Member Functions | |
| OptionHolder () | |
| Public constructor. | |
| void | add (MgpOption option) |
| Adds an MgpOption. | |
| MgpOption | getOption (int key) |
Gets the option specified by key. | |
| String | getValue (int key) |
| Gets the value of the option specified by key. | |
| void | delete (MgpOption option) |
| Deletes specified option. | |
| void | delete (int key) |
| Deletes all options with a key that is equal to the specified key. | |
| Vector | getValues (int key) |
| Gets all the values of the option specified by key, as a Vector of Strings. | |
| int | getIntValue (int key, int defaultValue) |
| Gets the value of the option specified by key. | |
| int | getIntValue (int key) throws NumberFormatException |
| Gets the value of the option specified by key. | |
| void | write (Writer out) throws IOException |
| Writes all options to the supplied stream on the format specified by the Messaging Gateway Protocol (MGP). | |
| Vector | getOptions () |
| Returns a vector containing all options in sequential order. | |
Static Public Member Functions | |
| static OptionHolder | load (BufferedReader in) throws IOException |
| Read all options from the supplied stream on the format specified by the Messaging Gateway Protocol (MGP). | |
Private Attributes | |
| Vector | options = new Vector() |
Container for message options.
| com::nmt::mgp::OptionHolder::OptionHolder | ( | ) | [inline] |
Public constructor.
Referenced by load().
| void com::nmt::mgp::OptionHolder::add | ( | MgpOption | option | ) | [inline] |
Adds an MgpOption.
| option | the option to add |
References options.
Referenced by com::nmt::mgp::Message::addHex(), com::nmt::mgp::Message::addOption(), com::nmt::mgp::Message::addText(), com::nmt::mgp::Message::addUdh(), com::nmt::mgp::MgpSession::dbexec(), com::nmt::mgp::MgpSession::deleteMessage(), load(), com::nmt::mgp::MgpSession::login(), com::nmt::mgp::Message::Message(), and com::nmt::mgp::MgpSession::queryMessage().
| void com::nmt::mgp::OptionHolder::delete | ( | MgpOption | option | ) | [inline] |
| void com::nmt::mgp::OptionHolder::delete | ( | int | key | ) | [inline] |
Deletes all options with a key that is equal to the specified key.
References com::nmt::mgp::MgpOption::getKey(), and options.
| int com::nmt::mgp::OptionHolder::getIntValue | ( | int | key | ) | throws NumberFormatException [inline] |
Gets the value of the option specified by key.
If there are multiple occurances the first one will be used.
| NumberFormatException | if no option with the key exists. |
References getValue().
| int com::nmt::mgp::OptionHolder::getIntValue | ( | int | key, | |
| int | defaultValue | |||
| ) | [inline] |
Gets the value of the option specified by key.
If no option with the key exists, the default value is returned.
Referenced by com::nmt::mgp::MgpSession::dbexec(), com::nmt::mgp::Message::getId(), and com::nmt::mgp::MgpSession::login().
| MgpOption com::nmt::mgp::OptionHolder::getOption | ( | int | key | ) | [inline] |
Gets the option specified by key.
References com::nmt::mgp::MgpOption::getKey(), and options.
| Vector com::nmt::mgp::OptionHolder::getOptions | ( | ) | [inline] |
Returns a vector containing all options in sequential order.
References options.
| String com::nmt::mgp::OptionHolder::getValue | ( | int | key | ) | [inline] |
Gets the value of the option specified by key.
If there are multiple occurances the first one will be used.
If no option with the key exists, null is returned.
References com::nmt::mgp::MgpOption::getKey(), com::nmt::mgp::MgpOption::getValue(), and options.
Referenced by com::nmt::mgp::MgpSession::deleteMessage(), getIntValue(), com::nmt::mgp::MgpSession::login(), com::nmt::mgp::MgpSession::queryMessage(), com::nmt::mgp::MgpSession::readResponse(), and com::nmt::mgp::MgpSession::sendMessage().
| Vector com::nmt::mgp::OptionHolder::getValues | ( | int | key | ) | [inline] |
Gets all the values of the option specified by key, as a Vector of Strings.
If no option with the key exists, an empty Vector is returned.
References com::nmt::mgp::MgpOption::getKey(), com::nmt::mgp::MgpOption::getValue(), and options.
Referenced by com::nmt::mgp::MgpSession::dbexec().
| static OptionHolder com::nmt::mgp::OptionHolder::load | ( | BufferedReader | in | ) | throws IOException [inline, static] |
Read all options from the supplied stream on the format specified by the Messaging Gateway Protocol (MGP).
References add(), OptionHolder(), and options.
Referenced by com::nmt::mgp::Message::load(), and com::nmt::mgp::Message::Message().
| void com::nmt::mgp::OptionHolder::write | ( | Writer | out | ) | throws IOException [inline] |
Writes all options to the supplied stream on the format specified by the Messaging Gateway Protocol (MGP).
References com::nmt::mgp::MgpOption::getKey(), com::nmt::mgp::MgpOption::getValue(), and options.
Referenced by com::nmt::mgp::Message::save().
Vector com::nmt::mgp::OptionHolder::options = new Vector() [private] |
Referenced by add(), delete(), getOption(), getOptions(), getValue(), getValues(), load(), and write().
1.7.1