pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A.J. (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIVOT-611) add a method hasListener() in ListenerList object
Date Thu, 26 Aug 2010 09:16:53 GMT

    [ https://issues.apache.org/jira/browse/PIVOT-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12902792#action_12902792
] 

A.J. commented on PIVOT-611:
----------------------------

Here it is

    /**
     * Check wether the listener has already been added
     *
     * @param listener
     * @return true if and only if the given listener has already been added to this list
     */
    public boolean contains(T listener) {
        if (listener == null) {
            throw new IllegalArgumentException("listener is null.");
        }

        Node node = first;
        while (node != null
                && node.listener != listener) {
                node = node.next;
        }

        return (node != null);
    }

If you want me to add it to the code base, please let me know how you want me to proceed (svn
commit ? patch ? ...)


> add a method hasListener() in ListenerList object
> -------------------------------------------------
>
>                 Key: PIVOT-611
>                 URL: https://issues.apache.org/jira/browse/PIVOT-611
>             Project: Pivot
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: A.J.
>            Priority: Minor
>
> there is no easy way to determine wether a listener has already been added to a listener
list (except by getting an iterator and traversing the list).
> it would be convenient to have 'hasListener' method in the ListenerList class that encapsulates
this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message