Apama Documentation : Connecting Apama Applications to External Components : Developing Custom Adapters : Java Codec Plug-in Development : The Codec Plug-in Development Specification for Java : Working with normalized events : The NormalisedEvent class
The NormalisedEvent class
The NormalisedEvent class represents a single normalized event. The following methods are provided for examining and modifying the name-value pairs making up the event:
*size - Return the number of elements (name-value pairs) currently stored by the event.
*empty - Check whether the event is empty or not.
*add - Add a new name-value pair to the event. The given name and value will be copied into the event. If an element with the same name already exists, it will not be overwritten. This returns an iterator into the events at the point where the new element was added.
*addQuick - Add a new name-value pair to the event. The given name and value will be copied into the event. If an element with the same name already exists, it will not be overwritten.
*remove - Remove the named element from the normalized event.
*removeAll - Remove all elements from the normalized event. The empty function will return true after this function has been called.
*replace - Change the value of a named element in the normalized event. If an element with the given name already exists, its value will be replaced with a copy of the given value. Otherwise, a new element is created just as though addQuick had been called.
*exists - Check whether a given element exists in the normalized event.
*find - Search for a named element in the normalized event. Returns an iterator into the event at the point where the element was located.
*findValue - Search for a named element in the normalized event and return its value.
*findValueAndRemove - Search for a named element in the normalized event and return its value. If found, the element will also be removed from the event. Returns null if the specified element does not exist or has value null.
*findValueAndRemove2 - Search for a named element in the normalized event and return its value. If found, the element will also be removed from the event. Unlike findValueAndRemove it throws an exception if the value is not found.
*first - Return an iterator pointing to the first element of the normalized event. Successive calls to the next function of the returned iterator will allow you to visit all the elements of the event.
*last - Return an iterator pointing to the last element of the normalized event. Successive calls to the back function of the returned iterator will allow you to visit all the elements of the event.
*toString - Return a printable string representation of the normalized event.
Threading note: Normalised events are not thread-safe. If your code will be accessing the same normalized event object (or associated iterators) from multiple threads, you must implement your own thread synchronization to prevent concurrent modification.
A public zero-argument constructor is provided for creation of new (initially empty) NormalisedEvent objects.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback