edu.wisc.my.portlets.bookmarks.domain.compare
Class DefaultBookmarksComparator

java.lang.Object
  extended by edu.wisc.my.portlets.bookmarks.domain.compare.DefaultBookmarksComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<Entry>

public class DefaultBookmarksComparator
extends java.lang.Object
implements java.util.Comparator<Entry>, java.io.Serializable

Implements the default comparison order for the objects involved in a BookmarkSet. Comparison follows these rules in order: Folders are always greater than non Folders. Entry fields are compared in the following order: name, note, created, modified. Bookmark fields are compared in the follwing order:

Version:
$Revision: 12141 $
Author:
Eric Dalquist eric.dalquist@doit.wisc.edu
See Also:
Serialized Form

Field Summary
static DefaultBookmarksComparator DEFAULT_BOOKMARKS_COMPARATOR
           
 
Constructor Summary
protected DefaultBookmarksComparator()
           
 
Method Summary
 int compare(Entry e1, Entry e2)
           
protected  int compareBookmarks(Entry e1, Entry e2)
          If both classes are not Bookmarks they are equal.
protected  int compareEntries(Entry e1, Entry e2)
          Compairs the entries by name, note, created and modified properties in that order.
protected  int compareFolders(Entry e1, Entry e2)
          Folders are always greater than non-Folders, if they are both Folders or both not Folders they are equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

DEFAULT_BOOKMARKS_COMPARATOR

public static DefaultBookmarksComparator DEFAULT_BOOKMARKS_COMPARATOR
Constructor Detail

DefaultBookmarksComparator

protected DefaultBookmarksComparator()
Method Detail

compare

public int compare(Entry e1,
                   Entry e2)
Specified by:
compare in interface java.util.Comparator<Entry>

compareFolders

protected int compareFolders(Entry e1,
                             Entry e2)
Folders are always greater than non-Folders, if they are both Folders or both not Folders they are equal.


compareEntries

protected int compareEntries(Entry e1,
                             Entry e2)
Compairs the entries by name, note, created and modified properties in that order.


compareBookmarks

protected int compareBookmarks(Entry e1,
                               Entry e2)
If both classes are not Bookmarks they are equal. If they are both bookmarks they are compared by url then newWindow properties.



Copyright © 1998-2007 Java Architectures Special Interest Group. All Rights Reserved.