public class CmsPriorityDateResourceComparator extends java.lang.Object implements java.io.Serializable, java.util.Comparator<CmsResource>
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.
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
PROPERTY_DATE
The name of the date property to read.
|
构造器和说明 |
---|
CmsPriorityDateResourceComparator(CmsObject cms,
boolean asc)
Creates a new instance of this comparator key.
|
限定符和类型 | 方法和说明 |
---|---|
int |
compare(CmsResource res0,
CmsResource res1) |
long |
getDate()
Returns the date of this resource comparator key.
|
int |
getPriority()
Returns the priority of this resource comparator key.
|
public static final java.lang.String PROPERTY_DATE
public CmsPriorityDateResourceComparator(CmsObject cms, boolean asc)
cms
- the current OpenCms user contextasc
- if true, the date sort order is ascending, otherwise descendingpublic int compare(CmsResource res0, CmsResource res1)
compare
在接口中 java.util.Comparator<CmsResource>
Comparator.compare(java.lang.Object, java.lang.Object)
public long getDate()
public int getPriority()