org.intermine.dataloader
Class SourcePriorityComparator
java.lang.Object
org.intermine.dataloader.SourcePriorityComparator
- All Implemented Interfaces:
- java.util.Comparator<InterMineObject>
public class SourcePriorityComparator
- extends java.lang.Object
- implements java.util.Comparator<InterMineObject>
Comparator, that compares two InterMineObjects, with reference to a particular
FieldDescriptor for priority.
| 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 |
SourcePriorityComparator
public SourcePriorityComparator(DataTracker dataTracker,
java.lang.Class<? extends InterMineObject> clazz,
java.lang.String fieldName,
Source def,
InterMineObject defObj,
IntPresentSet dbIdsStored,
IntegrationWriterAbstractImpl iw,
Source source,
Source skelSource,
PriorityConfig priorityConfig)
- Constructs a new Comparator for comparing objects for priority for a given field.
- Parameters:
dataTracker - the data trackerclazz - the Class of the resulting objectfieldName - the fieldName the comparison is fordef - the default SourcedefObj - a InterMineObject that came from a data source, not from the destination
objectstore, and should be associated with the default sourcedbIdsStored - the set of IDs stored in this dataloader run - improves error messagesiw - the IntegrationWriter creating this comparatorsource - the main source, as passed to iw.storeskelSource - the skeleton source, as passed to iw.storepriorityConfig - a PriorityConfig object for the target Model
compare
public int compare(InterMineObject o1,
InterMineObject o2)
- Compares two objects. These objects must both be InterMineObjects.
- Specified by:
compare in interface java.util.Comparator<InterMineObject>
- Parameters:
o1 - the first objecto2 - the second object
- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than,
equal to, or greater than the second
- Throws:
java.lang.ClassCastException - if either of the two objects is not a InterMineObject
java.lang.RuntimeException - if an error occurs in the underlying data tracking objectstore