Extension SDK

oracle.ide.model
Class DefaultFilter.SortedFolderFirstComparator

java.lang.Object
  |
  +--oracle.ide.model.DefaultFilter.SortedComparator
        |
        +--oracle.ide.model.DefaultFilter.SortedFolderFirstComparator
All Implemented Interfaces:
java.util.Comparator
Direct Known Subclasses:
HierarchicalFilter.HierarchicalComparator
Enclosing class:
DefaultFilter

public static class DefaultFilter.SortedFolderFirstComparator
extends DefaultFilter.SortedComparator

Builtin Comparator class for ordering the children of a container node, with container children ordered before non-container children. Each subgroup of children (container children or non-container children) is ordered in locale-sensitive collation order.

This class is an extension of the builtin TNode.SortedComparator class that provides one additional template method for determining where container children are ordered relative to non-container children.


Fields inherited from class oracle.ide.model.DefaultFilter.SortedComparator
collator
 
Constructor Summary
DefaultFilter.SortedFolderFirstComparator()
           
 
Method Summary
protected  int compareElements(Element e1, Element e2)
          Override of TNode.SortedComparator#compareElements(Element, Element) to call a different comparison routine when the Element objects are not either both Folders or both not Folders.
protected  int compareFolderToElement(Folder f, Element e)
          Deprecated. no longer used; equivalent to compareUnlikeElementToElement(Element,Element).
protected  int compareUnlikeElementToElement(Element f, Element e)
          Template method for comparing two unlike Element objects to each other.
 
Methods inherited from class oracle.ide.model.DefaultFilter.SortedComparator
compare, compareElementToElement, compareStrings, compareTNodes, equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFilter.SortedFolderFirstComparator

public DefaultFilter.SortedFolderFirstComparator()
Method Detail

compareElements

protected int compareElements(Element e1,
                              Element e2)
Override of TNode.SortedComparator#compareElements(Element, Element) to call a different comparison routine when the Element objects are not either both Folders or both not Folders.

Most subclasses should not need to override this method.

Overrides:
compareElements in class DefaultFilter.SortedComparator

compareUnlikeElementToElement

protected int compareUnlikeElementToElement(Element f,
                                            Element e)
Template method for comparing two unlike Element objects to each other. One Element object is not like another if only one of them is a container.

Subclasses may wish to override this method. The default implementation always returns -1, which causes container elements to be ordered before non-container elements.

Parameters:
f - an Element that may contain children
e - an Element that may not contain children

compareFolderToElement

protected int compareFolderToElement(Folder f,
                                     Element e)
Deprecated. no longer used; equivalent to compareUnlikeElementToElement(Element,Element).


Extension SDK