com.im.ijc.core/1 5.9.4

com.im.ijc.core.api.util
Class SharedDFItemComparator<T extends DFItem>

java.lang.Object
  extended by com.im.ijc.core.api.util.SharedDFItemComparator<T>
All Implemented Interfaces:
Comparator<T>

public final class SharedDFItemComparator<T extends DFItem>
extends Object
implements Comparator<T>

This Comparator orders DFItems as follows:

  1. Unsharable items, and sharable items that belong to the current user
  2. Items grouped by the owner user
Each group will be ordered according to the order of group's items as returned by DIF APIs.


Constructor Summary
SharedDFItemComparator(List<T> originalOrder, DFItem el)
          Creates a Comparator, which consults the originalOrder of items.
SharedDFItemComparator(List<T> originalOrder, String currentUser)
           
 
Method Summary
 int compare(T o1, T o2)
           
 String getCurrentUser()
           
 
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
 

Constructor Detail

SharedDFItemComparator

public SharedDFItemComparator(List<T> originalOrder,
                              DFItem el)
Creates a Comparator, which consults the originalOrder of items. The current user is taken from the DFSchema which is the parent of the DFItem el.

Parameters:
originalOrder - The original order
el - The schema component.

SharedDFItemComparator

public SharedDFItemComparator(List<T> originalOrder,
                              String currentUser)
Method Detail

getCurrentUser

public String getCurrentUser()

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T extends DFItem>

com.im.ijc.core/1 5.9.4