You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Greg Brown (JIRA)" <ji...@apache.org> on 2009/08/10 22:40:14 UTC

[jira] Created: (PIVOT-224) Support comparators in MapAdapter and SetAdapter

Support comparators in MapAdapter and SetAdapter
------------------------------------------------

                 Key: PIVOT-224
                 URL: https://issues.apache.org/jira/browse/PIVOT-224
             Project: Pivot
          Issue Type: Improvement
          Components: core-collections
    Affects Versions: 1.3
            Reporter: Greg Brown
            Priority: Trivial
             Fix For: 1.3


Use TreeMap/TreeSet as described below:

sample setComparator implementation:

private final TreeMap map;

public void setComparator(Comparator comp) {
 TreeMap newMap = new TreeMap(comp);
 newMap.addAll(this.map);
 this.map = newMap;
}


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


[jira] Updated: (PIVOT-224) Support comparators in MapAdapter and SetAdapter

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin updated PIVOT-224:
-------------------------------

    Attachment: collections.patch

Requires some reflection stuff to work nicely. 

My memory of applet security stuff is rusty - is the exception handling stuff here fine for applet use?

> Support comparators in MapAdapter and SetAdapter
> ------------------------------------------------
>
>                 Key: PIVOT-224
>                 URL: https://issues.apache.org/jira/browse/PIVOT-224
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-collections
>    Affects Versions: 1.3
>            Reporter: Greg Brown
>            Assignee: Noel Grandin
>            Priority: Trivial
>             Fix For: 1.3
>
>         Attachments: collections.patch
>
>
> Use TreeMap/TreeSet as described below:
> sample setComparator implementation:
> private final TreeMap map;
> public void setComparator(Comparator comp) {
>  TreeMap newMap = new TreeMap(comp);
>  newMap.addAll(this.map);
>  this.map = newMap;
> }

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


[jira] Commented: (PIVOT-224) Support comparators in MapAdapter and SetAdapter

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741857#action_12741857 ] 

Greg Brown commented on PIVOT-224:
----------------------------------

I assume you are asking if the reflection stuff will work in applets? If so, yes - we rely on reflection extensively in WTKXSerializer. But I'm not sure we really need to catch all of those exceptions. I'd suggest that you just catch the checked ones and re-throw them wrapped in a RuntimeException (UnsupportedOperationException doesn't seem like the right exception to throw here).

Also, just a few style comments:

- Add a space before your return calls.

- Comments should start with a capital letter, and don't generally require trailing punctuation.

- Avoid abbreviations like "cons" and "ex" - use "constructor" and "exception" instead.

- The "new" prefix in "newMap" is unnecessary - simply use "map" and use this.map for disambiguation (also, no need to use this when there is no ambiguity).

Otherwise, looks good.


> Support comparators in MapAdapter and SetAdapter
> ------------------------------------------------
>
>                 Key: PIVOT-224
>                 URL: https://issues.apache.org/jira/browse/PIVOT-224
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-collections
>    Affects Versions: 1.3
>            Reporter: Greg Brown
>            Assignee: Noel Grandin
>            Priority: Trivial
>             Fix For: 1.3
>
>         Attachments: collections.patch
>
>
> Use TreeMap/TreeSet as described below:
> sample setComparator implementation:
> private final TreeMap map;
> public void setComparator(Comparator comp) {
>  TreeMap newMap = new TreeMap(comp);
>  newMap.addAll(this.map);
>  this.map = newMap;
> }

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


[jira] Resolved: (PIVOT-224) Support comparators in MapAdapter and SetAdapter

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin resolved PIVOT-224.
--------------------------------

    Resolution: Fixed

Patch checked in with required changes.

> Support comparators in MapAdapter and SetAdapter
> ------------------------------------------------
>
>                 Key: PIVOT-224
>                 URL: https://issues.apache.org/jira/browse/PIVOT-224
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-collections
>    Affects Versions: 1.3
>            Reporter: Greg Brown
>            Assignee: Noel Grandin
>            Priority: Trivial
>             Fix For: 1.3
>
>         Attachments: collections.patch
>
>
> Use TreeMap/TreeSet as described below:
> sample setComparator implementation:
> private final TreeMap map;
> public void setComparator(Comparator comp) {
>  TreeMap newMap = new TreeMap(comp);
>  newMap.addAll(this.map);
>  this.map = newMap;
> }

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


[jira] Assigned: (PIVOT-224) Support comparators in MapAdapter and SetAdapter

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin reassigned PIVOT-224:
----------------------------------

    Assignee: Noel Grandin

> Support comparators in MapAdapter and SetAdapter
> ------------------------------------------------
>
>                 Key: PIVOT-224
>                 URL: https://issues.apache.org/jira/browse/PIVOT-224
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-collections
>    Affects Versions: 1.3
>            Reporter: Greg Brown
>            Assignee: Noel Grandin
>            Priority: Trivial
>             Fix For: 1.3
>
>
> Use TreeMap/TreeSet as described below:
> sample setComparator implementation:
> private final TreeMap map;
> public void setComparator(Comparator comp) {
>  TreeMap newMap = new TreeMap(comp);
>  newMap.addAll(this.map);
>  this.map = newMap;
> }

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