net.refractions.udig.issues
Class IssuesList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<IIssue>
              extended by net.refractions.udig.issues.IssuesList
All Implemented Interfaces:
java.lang.Iterable<IIssue>, java.util.Collection<IIssue>, java.util.List<IIssue>, IIssuesList

public class IssuesList
extends java.util.AbstractSequentialList<IIssue>
implements IIssuesList

An in-memory issues list. All issues will be lost at shut down unless save() is called. This is a useful utility class for implementing other issues list implementationss. The Datastore issues list (internal implementation) for example wraps this list and uses it to cache all of its issues.

Notifies listeners when issues are added or removed from list.

Since:
1.0.0
Author:
jones

Field Summary
 java.util.Collection<IIssuesListListener> listeners
          This is public for tesing purposes only!!!!
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
IssuesList()
           
 
Method Summary
 boolean add(IIssue o)
           
 void add(int index, IIssue element)
           
 boolean addAll(java.util.Collection<? extends IIssue> c)
           
 boolean addAll(int index, java.util.Collection<? extends IIssue> c)
           
 void addFirst(IIssue o)
           
 void addLast(IIssue o)
           
 void addListener(IIssuesListListener listener)
          Add Listener to list
 void clear()
           
 java.lang.String getExtensionID()
          Returns The extension id of the list as defined in a plugin.xml file.
 java.util.Set<java.lang.String> getGroups()
          Returns a set of all the issue groups that are in the list.
 java.util.List<IIssue> getIssues(java.lang.String groupId)
          Gets the all issues with the groupID
 java.util.ListIterator<IIssue> listIterator(int index)
           
 void load()
          Loads the issues list from the .issues.xml file in the workspace
protected  void notify(java.util.Collection<? extends IIssue> changed, IssuesListEventType type)
           
 void notify(IIssue changed, IssuesListEventType type)
          Notify listeners of a change to the list.
 IIssue remove()
           
 IIssue remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 IIssue removeFirst()
           
 void removeIssues(java.lang.String groupId)
          Remove all issues in the group.
 IIssue removeLast()
           
 void removeListener(IIssuesListListener listener)
          Remove listener from list
 boolean retainAll(java.util.Collection<?> c)
           
 void save()
          Saves the issues list to the .issues.xml file in the workspace
 IIssue set(int index, IIssue element)
           
 void setNotify(boolean notifyListeners)
          Sets it so that adds and removes will not raise notifications.
 int size()
           
 
Methods inherited from class java.util.AbstractSequentialList
get, iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, subList, toArray, toArray
 

Field Detail

listeners

public java.util.Collection<IIssuesListListener> listeners
This is public for tesing purposes only!!!!

Constructor Detail

IssuesList

public IssuesList()
Method Detail

add

public boolean add(IIssue o)
Specified by:
add in interface java.util.Collection<IIssue>
Specified by:
add in interface java.util.List<IIssue>
Overrides:
add in class java.util.AbstractList<IIssue>

add

public void add(int index,
                IIssue element)
Specified by:
add in interface java.util.List<IIssue>
Overrides:
add in class java.util.AbstractSequentialList<IIssue>

addAll

public boolean addAll(java.util.Collection<? extends IIssue> c)
Specified by:
addAll in interface java.util.Collection<IIssue>
Specified by:
addAll in interface java.util.List<IIssue>
Overrides:
addAll in class java.util.AbstractCollection<IIssue>

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends IIssue> c)
Specified by:
addAll in interface java.util.List<IIssue>
Overrides:
addAll in class java.util.AbstractSequentialList<IIssue>

addFirst

public void addFirst(IIssue o)

addLast

public void addLast(IIssue o)

remove

public IIssue remove()

remove

public IIssue remove(int index)
Specified by:
remove in interface java.util.List<IIssue>
Overrides:
remove in class java.util.AbstractSequentialList<IIssue>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<IIssue>
Specified by:
remove in interface java.util.List<IIssue>
Overrides:
remove in class java.util.AbstractCollection<IIssue>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<IIssue>
Specified by:
removeAll in interface java.util.List<IIssue>
Overrides:
removeAll in class java.util.AbstractCollection<IIssue>

removeFirst

public IIssue removeFirst()

removeLast

public IIssue removeLast()

set

public IIssue set(int index,
                  IIssue element)
Specified by:
set in interface java.util.List<IIssue>
Overrides:
set in class java.util.AbstractSequentialList<IIssue>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<IIssue>
Specified by:
retainAll in interface java.util.List<IIssue>
Overrides:
retainAll in class java.util.AbstractCollection<IIssue>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<IIssue>
Specified by:
clear in interface java.util.List<IIssue>
Overrides:
clear in class java.util.AbstractList<IIssue>

addListener

public void addListener(IIssuesListListener listener)
Description copied from interface: IIssuesList
Add Listener to list

Specified by:
addListener in interface IIssuesList
Parameters:
listener - listener to add

removeListener

public void removeListener(IIssuesListListener listener)
Description copied from interface: IIssuesList
Remove listener from list

Specified by:
removeListener in interface IIssuesList
Parameters:
listener - listener to remove

notify

protected void notify(java.util.Collection<? extends IIssue> changed,
                      IssuesListEventType type)

notify

public void notify(IIssue changed,
                   IssuesListEventType type)
Notify listeners of a change to the list.

Parameters:
changed - issue that has changed.
type - Type of change.

getGroups

public java.util.Set<java.lang.String> getGroups()
Description copied from interface: IIssuesList
Returns a set of all the issue groups that are in the list.

Specified by:
getGroups in interface IIssuesList
Returns:
a set of all the issue groups.

getIssues

public java.util.List<IIssue> getIssues(java.lang.String groupId)
Description copied from interface: IIssuesList
Gets the all issues with the groupID

Specified by:
getIssues in interface IIssuesList
Parameters:
groupId - groupId of a group of issues
Returns:
all issues with the groupID

removeIssues

public void removeIssues(java.lang.String groupId)
Description copied from interface: IIssuesList
Remove all issues in the group.

Specified by:
removeIssues in interface IIssuesList
Parameters:
groupId - group id of issues to remove

listIterator

public java.util.ListIterator<IIssue> listIterator(int index)
Specified by:
listIterator in interface java.util.List<IIssue>
Specified by:
listIterator in class java.util.AbstractSequentialList<IIssue>

size

public int size()
Specified by:
size in interface java.util.Collection<IIssue>
Specified by:
size in interface java.util.List<IIssue>
Specified by:
size in class java.util.AbstractCollection<IIssue>

getExtensionID

public java.lang.String getExtensionID()
Description copied from interface: IIssuesList
Returns The extension id of the list as defined in a plugin.xml file.

Specified by:
getExtensionID in interface IIssuesList
Returns:
The extension id of the list as defined in a plugin.xml file.

setNotify

public void setNotify(boolean notifyListeners)
Sets it so that adds and removes will not raise notifications.

Parameters:
notifyListeners - true if notifications should be sent

load

public void load()
Loads the issues list from the .issues.xml file in the workspace


save

public void save()
Saves the issues list to the .issues.xml file in the workspace