|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.comparator.SafeComparator
com.tangosol.util.comparator.EntryComparator
public class EntryComparator
Comparator implementation used to compare map entries. Depending on the comparison style this comparator will compare entries' values, entries' keys or, when the provided comparator is an instance of QueryMapComparator, the entries themselves.
| Field Summary | |
|---|---|
static int |
CMP_AUTOIndicates that this EntryComparator should choose the comparison style based on the underying comparator type. |
static int |
CMP_ENTRYIndicates that entries that implement QueryMap.Entry interface will be compared using the compareEntries() method. |
static int |
CMP_KEYIndicates that this EntryComparator should compare the entries' keys. |
static int |
CMP_VALUEIndicates that this EntryComparator should compare the entries' values. |
protected int |
m_nStyleComparison style utilized by this EntryComparator. |
| Fields inherited from class com.tangosol.util.comparator.SafeComparator |
|---|
INSTANCE, m_comparator |
| Constructor Summary | |
|---|---|
EntryComparator()Default constructor (for ExternalizableLite and PortableObject). |
|
EntryComparator(java.util.Comparator comparator)Construct an EntryComparator to compare entries' values using the provided Comparator object. |
|
EntryComparator(java.util.Comparator comparator, int nStyle)Construct an EntryComparator to compare entries using the provided Comparator object according to the specified comparison style. |
|
| Method Summary | |
|---|---|
int |
compare(java.lang.Object o1, java.lang.Object o2)Compares two arguments for order. |
boolean |
equals(java.lang.Object o)Determine if two EntryComparator objects are equal. |
int |
getComparisonStyle()Obtain the comparison style value utilized by this EntryComparator. |
boolean |
isCompareEntry()Check whether or not this EntryComparator pass entries themselves for comparison to the underlying compareEntries() method. |
boolean |
isCompareKey()Check whether or not this EntryComparator uses entries' keys to pass for comparison to the underlying Comparator. |
boolean |
isCompareValue()Check whether or not this EntryComparator uses entries' values to pass for comparison to the underlying Comparator. |
void |
readExternal(java.io.DataInput in)Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(PofReader in)Restore the contents of a user type instance by reading its state using the specified PofReader object. |
void |
writeExternal(java.io.DataOutput out)Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(PofWriter out)Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
| Methods inherited from class com.tangosol.util.comparator.SafeComparator |
|---|
compareEntries, compareSafe, getComparator, hashCode, isKeyComparator, isKeyComparator, toString |
| Field Detail |
|---|
public static final int CMP_AUTO
public static final int CMP_VALUE
public static final int CMP_KEY
public static final int CMP_ENTRY
QueryMap.Entry interface will be compared using the compareEntries() method.
protected int m_nStyle
| Constructor Detail |
|---|
public EntryComparator()
public EntryComparator(java.util.Comparator comparator)
KeyExtractor, the CMP_KEY style will be assumed; otherwise, the CMP_VALUE style is used.
comparator - the comparator to use; if not specified the "natural" comparison of entries' values is used
public EntryComparator(java.util.Comparator comparator,
int nStyle)
KeyExtractor, the CMP_KEY style will be assumed; otherwise, the CMP_VALUE style is used.
comparator - the comparator to use; if not specified the "natural" comparison is usednStyle - the comparison style to use; valid values are any of the CMP_* constants| Method Detail |
|---|
public int compare(java.lang.Object o1,
java.lang.Object o2)
Map.Entry objects. Depending on the comparison style, this method will pass either the entries' values, keys or the entries themselves to the underlying Comparator.compare in interface java.util.Comparatorcompare in class SafeComparatoro1 - the first object to be comparedo2 - the second object to be comparedpublic boolean equals(java.lang.Object o)
equals in interface java.util.Comparatorequals in class SafeComparatoro - the other objectpublic int getComparisonStyle()
public boolean isCompareValue()
public boolean isCompareKey()
public boolean isCompareEntry()
compareEntries() method.
public void readExternal(java.io.DataInput in)
throws java.io.IOException
readExternal in interface ExternalizableLitereadExternal in class SafeComparatorin - the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException - if an I/O exception occursjava.io.NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
public void writeExternal(java.io.DataOutput out)
throws java.io.IOException
writeExternal in interface ExternalizableLitewriteExternal in class SafeComparatorout - the DataOutput stream to write the state of this object tojava.io.IOException - if an I/O exception occurs
public void readExternal(PofReader in)
throws java.io.IOException
readExternal in interface PortableObjectreadExternal in class SafeComparatorin - the PofReader from which to read the object's statejava.io.IOException - if an I/O error occurs
public void writeExternal(PofWriter out)
throws java.io.IOException
writeExternal in interface PortableObjectwriteExternal in class SafeComparatorout - the PofWriter to which to write the object's statejava.io.IOException - if an I/O error occurs
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||