org.opencms.file.collectors
Class CmsPriorityTitleResourceComparator

java.lang.Object
  extended by org.opencms.file.collectors.CmsPriorityTitleResourceComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public class CmsPriorityTitleResourceComparator
extends java.lang.Object
implements java.io.Serializable, java.util.Comparator

Comparator for sorting resource objects based on priority and title.

Serves as Comparator for resources and as comparator key for the resource at the same time. Uses lazy initializing of comparator keys in a resource.

Since:
6.0.0
Version:
$Revision: 1.21 $
Author:
Andreas Zahner
See Also:
Serialized Form

Constructor Summary
CmsPriorityTitleResourceComparator(CmsObject cms)
          Creates a new instance of this comparator key.
 
Method Summary
 int compare(java.lang.Object arg0, java.lang.Object arg1)
           
 int getPriority()
          Returns the priority of this resource comparator key.
 java.lang.String getTitle()
          Returns the title of this resource comparator key.
 
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
 

Constructor Detail

CmsPriorityTitleResourceComparator

public CmsPriorityTitleResourceComparator(CmsObject cms)
Creates a new instance of this comparator key.

Parameters:
cms - the current OpenCms user context
Method Detail

compare

public int compare(java.lang.Object arg0,
                   java.lang.Object arg1)
Specified by:
compare in interface java.util.Comparator
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)

getPriority

public int getPriority()
Returns the priority of this resource comparator key.

Returns:
the priority of this resource comparator key

getTitle

public java.lang.String getTitle()
Returns the title of this resource comparator key.

Returns:
the title of this resource comparator key