|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
org.opennms.netmgt.eventd.datablock.EventMaskValueList
The maskelement values in a 'EventKey' are stored in this ArrayList subclass This list is pretty much constant once it constructed - so the hashcode is evaluated once at construction and reused(if new values are added or values changed, hashcode is re-evaluated)
Nested Class Summary |
Nested classes inherited from class java.util.AbstractList |
|
Field Summary | |
private int |
m_hashCode
The hash code calculated from the elements |
Fields inherited from class java.util.ArrayList |
|
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
EventMaskValueList()
Default constructor for this class |
|
EventMaskValueList(java.util.Collection c)
constructor for this class |
|
EventMaskValueList(int initCapacity)
constructor for this class |
|
EventMaskValueList(java.lang.String value)
the constructor for this class |
Method Summary | |
void |
add(int index,
java.lang.Object o)
Override to re-evaluate hashcode |
boolean |
add(java.lang.Object o)
Override to re-evaluate hashcode |
boolean |
addAll(java.util.Collection o)
Override to re-evaluate hashcode |
boolean |
addAll(int index,
java.util.Collection o)
Override to re-evaluate hashcode |
void |
clear()
Override to re-evaluate hashcode |
void |
evaluateHashCode()
Evaluate the hash code for this object |
private int |
evaluateHashCode(java.lang.String value)
Handling the mask values ending with '%' is a pain since the hashcodes will need to work in reverse! |
int |
hashCode()
Overrides the 'hashCode()' method in the superclass. |
java.lang.Object |
remove(int index)
Override to re-evaluate hashcode |
boolean |
remove(java.lang.Object o)
Override to re-evaluate hashcode |
boolean |
removeAll(java.util.Collection o)
Override to re-evaluate hashcode |
protected void |
removeRange(int from,
int to)
Override to re-evaluate hashcode |
java.lang.Object |
set(int index,
java.lang.Object o)
Override to re-evaluate hashcode |
Methods inherited from class java.util.ArrayList |
clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, retainAll, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
containsAll, equals, iterator, listIterator, listIterator, retainAll, subList |
Field Detail |
private int m_hashCode
Constructor Detail |
public EventMaskValueList()
public EventMaskValueList(java.util.Collection c)
public EventMaskValueList(int initCapacity)
public EventMaskValueList(java.lang.String value)
value
- the string to be added to this list.Method Detail |
public boolean add(java.lang.Object o)
ArrayList.add(Object)
public void add(int index, java.lang.Object o)
ArrayList.add(int, Object)
public boolean addAll(java.util.Collection o)
ArrayList.addAll(Collection)
public boolean addAll(int index, java.util.Collection o)
ArrayList.addAll(int, Collection)
public void clear()
ArrayList.clear()
public java.lang.Object remove(int index)
ArrayList.remove(int)
protected void removeRange(int from, int to)
ArrayList.removeRange(int,int)
public boolean remove(java.lang.Object o)
AbstractCollection.remove(Object)
public boolean removeAll(java.util.Collection o)
AbstractCollection.removeAll(Collection)
public java.lang.Object set(int index, java.lang.Object o)
ArrayList.set(int,Object)
private int evaluateHashCode(java.lang.String value)
Handling the mask values ending with '%' is a pain since the hashcodes will need to work in reverse!
For e.g. consider mask values '.1.3.6.1.4.1.9%' and '.1.3.6.1.4.1.%' normal hashcodes will mean '.1.3.6.1.4.1.9%' will have a larger hashcode. However when we try a match in the eventconf(which uses a treemap of eventkeys to get the event keys in an ordered fashion), we want '.1.3.6.1.4.1.9%' to be a better match than '.1.3.6.1.4.1.%' - i.e.we want '.1.3.6.1.4.1.9%' to have a lesser hashcode than '.1.3.6.1.4.1.%' - hence this method. Only a lot of testing will reveal conflicts etc. though
public void evaluateHashCode()
public int hashCode()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |