public class PropertyFilter extends Object
| Constructor and Description |
|---|
PropertyFilter(Properties prop)
Constructs a PropertyFilter object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Object element)
Checks whether an element is accepted by this filter, the element
must be either
NetModule or Device. |
void |
addProperty(String key,
String value)
Adds a (key,value) pair to the filter.
|
boolean |
contains(String key)
Checks whether a key is in the list.
|
void |
removeKey(String key)
Remove a key from the filter, if the key is not in the property
list, no action is taken.
|
void |
removeKeys(String[] keys)
Remove keys from the filter, if a key is not in the property list,
it is disregarded; while others are processed as normal.
|
public PropertyFilter(Properties prop)
prop - Initial properties for this Property filterpublic void addProperty(String key, String value)
key - New key which will be used for filtering.value - Value for the new key.public boolean contains(String key)
key - Key to be checked against.public boolean accept(Object element)
NetModule or Device.
If a NetModule/Device's properties share the same value as all
properties from this filter, it is accepted and true is returned;
otherwise, false is returned.element - Element to be checked against.public void removeKey(String key)
key - Key to be removed from list.public void removeKeys(String[] keys)
keys - Keys to be removed from the list.Copyright © 2012. All Rights Reserved.