fulmine.util.collection
Interface IReferenceCountingList<COMPONENT>

Type Parameters:
COMPONENT - the element type for the list
All Superinterfaces:
Collection<COMPONENT>, Iterable<COMPONENT>, List<COMPONENT>
All Known Implementing Classes:
ReferenceCountingList

public interface IReferenceCountingList<COMPONENT>
extends List<COMPONENT>

A List that only allows unique elements and keeps a count of the number of attempts to add the element. This provides a reference count for the elements but preserves the initial adding order of the elements. Calling remove on the element will decrement the reference count, when this is 0 the element is removed from the list.

Author:
Ramon Servadei

Method Summary
 int getCount(COMPONENT element)
          Get the number of references this list maintains for the element.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

getCount

int getCount(COMPONENT element)
Get the number of references this list maintains for the element. Calls to List.add(Object) increments the count, calls to List.remove(Object) decrements the count.

Parameters:
element - the element to query for the reference count
Returns:
the number of references to the element for this list


Copyright © 2007-2009. All Rights Reserved.