public class ItemComparator extends Object implements Comparator, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected String |
element
Dublin Core element
|
protected ItemService |
itemService |
protected String |
language
Language
|
protected boolean |
max
Whether maximum or minimum value will be used
|
protected String |
qualifier
Dublin Core qualifier
|
| Constructor and Description |
|---|
ItemComparator(String element,
String qualifier,
String language,
boolean max)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Object first,
Object second)
Compare two Items by checking their DCValues for element, qualifier, and
language.
|
boolean |
equals(Object obj)
Return true if the object is equal to this one, false otherwise.
|
protected boolean |
equalsWithNull(String first,
String second) |
protected String |
getValue(Item item)
Choose the canonical value from an item for comparison.
|
int |
hashCode() |
protected String |
normalizeTitle(MetadataValue value)
Normalize the title of a Metadatum.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongprotected String element
protected String qualifier
protected String language
protected boolean max
protected transient ItemService itemService
public ItemComparator(String element, String qualifier, String language, boolean max)
element - The Dublin Core elementqualifier - The Dublin Core qualifierlanguage - The language for the DCValuesmax - If true, and there is more than one Metadatum for element,
qualifier and language, then use the maximum value
lexicographically; otherwise use the minimum value.public int compare(Object first, Object second)
Return greater than or equal to 1 if the first is lexicographically greater than the second; less than or equal to -1 if the second is lexicographically greater than the first, and 0 otherwise.
compare in interface Comparatorfirst - The first object to compare. Must be an object of type
org.dspace.content.Item.second - The second object to compare. Must be an object of type
org.dspace.content.Item.public boolean equals(Object obj)
equals in interface Comparatorequals in class Objectobj - The object to compare to.protected boolean equalsWithNull(String first, String second)
first - second - protected String getValue(Item item)
item - The item to checkprotected String normalizeTitle(MetadataValue value)
value - Copyright © 2017 DuraSpace. All rights reserved.