class SortedEntryComparator
extends java.lang.Object
implements java.util.Comparator<org.apache.directory.api.ldap.model.entry.Entry>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private org.apache.directory.api.ldap.model.schema.LdapComparator |
comparator
comparator used for comparing the values of the given attribute type
|
private boolean |
hr
flag to indicate if the attribute is human readable or binary
|
private boolean |
multivalued
flag to indicate if the attribute type is multivalued
|
private boolean |
reverse
flag for indicating the order of sorting
|
private org.apache.directory.api.ldap.model.schema.AttributeType |
type
the attribute's type
|
| Constructor and Description |
|---|
SortedEntryComparator(org.apache.directory.api.ldap.model.schema.AttributeType at,
java.lang.String mrule,
boolean reverse,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Creates a new instance of SortedEntryComparator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(org.apache.directory.api.ldap.model.entry.Entry entry1,
org.apache.directory.api.ldap.model.entry.Entry entry2) |
private java.lang.Object |
sortAndGetFirst(org.apache.directory.api.ldap.model.entry.Attribute at,
java.util.TreeSet ts)
sorts the values of an attribute and picks the least value
|
private transient org.apache.directory.api.ldap.model.schema.AttributeType type
private transient org.apache.directory.api.ldap.model.schema.LdapComparator comparator
private boolean multivalued
private boolean reverse
private boolean hr
public SortedEntryComparator(org.apache.directory.api.ldap.model.schema.AttributeType at,
java.lang.String mrule,
boolean reverse,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
throws org.apache.directory.api.ldap.model.exception.LdapException
at - the attribute's typemrOid - the OID or name of the matchingrulereverse - flag to indicate the sort orderorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic int compare(org.apache.directory.api.ldap.model.entry.Entry entry1,
org.apache.directory.api.ldap.model.entry.Entry entry2)
compare in interface java.util.Comparator<org.apache.directory.api.ldap.model.entry.Entry>private java.lang.Object sortAndGetFirst(org.apache.directory.api.ldap.model.entry.Attribute at,
java.util.TreeSet ts)
at - the attributets - the TreeSet for sorting