org.opennms.netmgt.eventd.datablock
Class EventMaskValueList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<String>
              extended by org.opennms.netmgt.eventd.datablock.EventMaskValueList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, List<String>, RandomAccess

public class EventMaskValueList
extends ArrayList<String>

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)

Author:
Sowmya Nataraj , OpenNMS.org
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
EventMaskValueList()
          Default constructor for this class
EventMaskValueList(Collection<String> c)
          constructor for this class
EventMaskValueList(int initCapacity)
          constructor for this class
EventMaskValueList(String value)
          the constructor for this class
 
Method Summary
 void add(int index, String o)
          Override to re-evaluate hashcode
 boolean add(String o)
          Override to re-evaluate hashcode
 boolean addAll(Collection<? extends String> o)
          Override to re-evaluate hashcode
 boolean addAll(int index, Collection<? extends String> o)
          Override to re-evaluate hashcode
 void clear()
          Override to re-evaluate hashcode
 void evaluateHashCode()
          Evaluate the hash code for this object
 int hashCode()
          Overrides the 'hashCode()' method in the superclass.
 String remove(int index)
          Override to re-evaluate hashcode
 boolean remove(String o)
          Override to re-evaluate hashcode
 boolean removeAll(Collection o)
          Override to re-evaluate hashcode
protected  void removeRange(int from, int to)
          Override to re-evaluate hashcode
 String set(int index, String o)
          Override to re-evaluate hashcode
 
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, 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
 

Constructor Detail

EventMaskValueList

public EventMaskValueList()
Default constructor for this class


EventMaskValueList

public EventMaskValueList(Collection<String> c)
constructor for this class


EventMaskValueList

public EventMaskValueList(int initCapacity)
constructor for this class


EventMaskValueList

public EventMaskValueList(String value)
the constructor for this class

Parameters:
value - the string to be added to this list.
Method Detail

add

public boolean add(String o)
Override to re-evaluate hashcode

Specified by:
add in interface Collection<String>
Specified by:
add in interface List<String>
Overrides:
add in class ArrayList<String>
See Also:
ArrayList.add(Object)

add

public void add(int index,
                String o)
Override to re-evaluate hashcode

Specified by:
add in interface List<String>
Overrides:
add in class ArrayList<String>
See Also:
ArrayList.add(int, Object)

addAll

public boolean addAll(Collection<? extends String> o)
Override to re-evaluate hashcode

Specified by:
addAll in interface Collection<String>
Specified by:
addAll in interface List<String>
Overrides:
addAll in class ArrayList<String>
See Also:
ArrayList.addAll(Collection)

addAll

public boolean addAll(int index,
                      Collection<? extends String> o)
Override to re-evaluate hashcode

Specified by:
addAll in interface List<String>
Overrides:
addAll in class ArrayList<String>
See Also:
ArrayList.addAll(int, Collection)

clear

public void clear()
Override to re-evaluate hashcode

Specified by:
clear in interface Collection<String>
Specified by:
clear in interface List<String>
Overrides:
clear in class ArrayList<String>
See Also:
ArrayList.clear()

remove

public String remove(int index)
Override to re-evaluate hashcode

Specified by:
remove in interface List<String>
Overrides:
remove in class ArrayList<String>
See Also:
ArrayList.remove(int)

removeRange

protected void removeRange(int from,
                           int to)
Override to re-evaluate hashcode

Overrides:
removeRange in class ArrayList<String>
See Also:
ArrayList.removeRange(int,int)

remove

public boolean remove(String o)
Override to re-evaluate hashcode

See Also:
ArrayList.remove(Object)

removeAll

public boolean removeAll(Collection o)
Override to re-evaluate hashcode

Specified by:
removeAll in interface Collection<String>
Specified by:
removeAll in interface List<String>
Overrides:
removeAll in class AbstractCollection<String>
See Also:
AbstractCollection.removeAll(Collection)

set

public String set(int index,
                  String o)
Override to re-evaluate hashcode

Specified by:
set in interface List<String>
Overrides:
set in class ArrayList<String>
See Also:
ArrayList.set(int,Object)

evaluateHashCode

public void evaluateHashCode()
Evaluate the hash code for this object


hashCode

public int hashCode()
Overrides the 'hashCode()' method in the superclass.

Specified by:
hashCode in interface Collection<String>
Specified by:
hashCode in interface List<String>
Overrides:
hashCode in class AbstractList<String>
Returns:
a hash code for this object


Copyright © 2009. All Rights Reserved.