com.im.df.api 5.9

com.im.df.api.support
Class SortDirective

java.lang.Object
  extended by com.im.df.api.support.SortDirective

public final class SortDirective
extends Object

This class describes sorts - it contains list of couples [DFField, boolean flag asc/desc] SortDirective is immutable object - once it is created it cannot be changed. You need to create a new one if you want to add new DFField or change asc/desc flag.


Nested Class Summary
static class SortDirective.Item
          Represents one item in SortDirective, it means a single couple [DFField, boolean flag asc/desc].
 
Field Summary
static SortDirective EMPTY
          Empty sort constant
 
Method Summary
static SortDirective create(DFField[] fields, boolean[] ascendings)
          Create a complex SortDirective for more fields.
static SortDirective create(DFField field, boolean isAscending)
          Create SortDirective if you want to sort only a single field.
 boolean equals(Object obj)
           
 List<DFField> getFields()
          Get all fields which participates in this SortDirective.
 List<SortDirective.Item> getSorts()
          Get list of pairs [DFField, asc/desc]
 int hashCode()
           
static SortDirective merge(SortDirective sort, DFField field, boolean ascending)
          Utility method for adding one or more field to existing SortDirective.
static SortDirective removeFields(SortDirective sort, List<DFField> fields)
          Utility method for removing one field from the existing SortDirective.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final SortDirective EMPTY
Empty sort constant

Method Detail

create

public static SortDirective create(DFField field,
                                   boolean isAscending)
Create SortDirective if you want to sort only a single field.


create

public static SortDirective create(DFField[] fields,
                                   boolean[] ascendings)
Create a complex SortDirective for more fields.

Throws:
IllegalArgumentException - is thrown when the lengths of arrays are different

merge

public static SortDirective merge(SortDirective sort,
                                  DFField field,
                                  boolean ascending)
Utility method for adding one or more field to existing SortDirective. The new SortDirective is returned.


removeFields

public static SortDirective removeFields(SortDirective sort,
                                         List<DFField> fields)
Utility method for removing one field from the existing SortDirective. The new SortDirective is returned.


getFields

public List<DFField> getFields()
Get all fields which participates in this SortDirective.


getSorts

public List<SortDirective.Item> getSorts()
Get list of pairs [DFField, asc/desc]


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

com.im.df.api 5.9