Class Monitors
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.logicmachine.rebl.common.Many
addAll, addAll, clear, findAll, getCollection, iterator, size, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Monitors
public Monitors()Default constructor.
-
-
Method Details
-
add
Description copied from class:Some
This method allows the given 'entity' to be added to the current collection. -
find
Searches this collection for a Monitor whose key matches the given 'key' value. Returns the first matching Monitor on match, or null on no match.- Parameters:
key
- holds the key to search for (can be null)- Returns:
- either the first Monitor matching the given 'key', or null on no match
-
find
Description copied from class:Many
Searches this collection for an element whose key matches the given 'key' value. Returns the first matching element on match, or the given 'empty' instance on no match.
As an implementation note, this class is backed by a List. Therefore the 'find()' and 'findAll()' methods complete in O(n) time.
See also the related 'Some' class which is backed by a Map and whose 'find()' and 'findAll()' methods complete in O(1) time - but cannot contain duplicate keys.
See also the 'allowNull()' method.- Overrides:
find
in classMany<Monitor<?>>
- Parameters:
key
- holds the key to search for (can be null)empty
- holds the empty instance which will be returned on no match (must not be null unless the 'allowNull()' method has previously been called)- Returns:
- either the first element matching the given 'key', or the specified 'empty' instance on no match or if 'key' is null
-