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/11 15:22:14 UTC
[jira] Commented: (PIVOT-224) Support comparators in MapAdapter and
SetAdapter
[ 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.