edu.northwestern.at.wordhoard.model.bibtool
Class GroupingWorkOptions

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.bibtool.GroupingWorkOptions

public class GroupingWorkOptions
extends java.lang.Object

A set of grouping options.


Field Summary
static int ASCENDING
          Ascending option.
static int DESCENDING
          Descending option.
static int GROUP_BY_AUTHOR
          Group by author option.
static int GROUP_BY_CENTURY
          Group by quarter century option.
static int GROUP_BY_DECADE
          Group by decade option.
static java.lang.String[] GROUP_BY_NAMES
          Grouping option names.
static int GROUP_BY_NONE
          No grouping option.
static int GROUP_BY_QCENTURY
          Group by quarter century option.
static int GROUP_BY_YEAR
          Group by year option.
static int ORDER_BY_AUTHOR
          Order by Author.
static int ORDER_BY_COUNT
          Order by count - used for group by author.
static int ORDER_BY_DATE
          Order by date option.
static java.lang.String[] ORDER_BY_NAMES
          Ordering option names.
static int ORDER_BY_WORK
          Order by title.
static java.lang.String[] UP_DOWN_NAMES
          Ascending/descending option names.
 
Constructor Summary
GroupingWorkOptions(int groupBy, int orderBy, int upDown)
          Creates a new set of grouping options.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
 int getGroupBy()
          Gets the grouping option.
 int getOrderBy()
          Gets the ordering option.
 int getUpDown()
          Gets the ascending/descending option.
 java.util.Map group(java.util.Collection works)
          Groups a collection of works.
 void setGroupBy(int groupBy)
          Sets the grouping option.
 void setOrderBy(int orderBy)
          Sets the ordering option.
 void setUpDown(int upDown)
          Sets the ascending/descending option.
 java.util.List sort(java.util.Collection works)
          Sort a collection of works.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_BY_NONE

public static final int GROUP_BY_NONE
No grouping option.

See Also:
Constant Field Values

GROUP_BY_AUTHOR

public static final int GROUP_BY_AUTHOR
Group by author option.

See Also:
Constant Field Values

GROUP_BY_YEAR

public static final int GROUP_BY_YEAR
Group by year option.

See Also:
Constant Field Values

GROUP_BY_DECADE

public static final int GROUP_BY_DECADE
Group by decade option.

See Also:
Constant Field Values

GROUP_BY_QCENTURY

public static final int GROUP_BY_QCENTURY
Group by quarter century option.

See Also:
Constant Field Values

GROUP_BY_CENTURY

public static final int GROUP_BY_CENTURY
Group by quarter century option.

See Also:
Constant Field Values

GROUP_BY_NAMES

public static final java.lang.String[] GROUP_BY_NAMES
Grouping option names.


ORDER_BY_WORK

public static final int ORDER_BY_WORK
Order by title.

See Also:
Constant Field Values

ORDER_BY_AUTHOR

public static final int ORDER_BY_AUTHOR
Order by Author.

See Also:
Constant Field Values

ORDER_BY_DATE

public static final int ORDER_BY_DATE
Order by date option.

See Also:
Constant Field Values

ORDER_BY_COUNT

public static final int ORDER_BY_COUNT
Order by count - used for group by author.

See Also:
Constant Field Values

ORDER_BY_NAMES

public static final java.lang.String[] ORDER_BY_NAMES
Ordering option names.


ASCENDING

public static final int ASCENDING
Ascending option.

See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
Descending option.

See Also:
Constant Field Values

UP_DOWN_NAMES

public static final java.lang.String[] UP_DOWN_NAMES
Ascending/descending option names.

Constructor Detail

GroupingWorkOptions

public GroupingWorkOptions(int groupBy,
                           int orderBy,
                           int upDown)
Creates a new set of grouping options.

Parameters:
groupBy - Grouping option.
orderBy - Ordering option.
upDown - Ascending/descending option.
Method Detail

getGroupBy

public int getGroupBy()
Gets the grouping option.

Returns:
Grouping option.

setGroupBy

public void setGroupBy(int groupBy)
Sets the grouping option.

Parameters:
groupBy - Grouping option.

getOrderBy

public int getOrderBy()
Gets the ordering option.

Returns:
Ordering option.

setOrderBy

public void setOrderBy(int orderBy)
Sets the ordering option.

Parameters:
orderBy - Ordering option.

getUpDown

public int getUpDown()
Gets the ascending/descending option.

Returns:
Ascending/descending option.

setUpDown

public void setUpDown(int upDown)
Sets the ascending/descending option.

Parameters:
upDown - Ascending/descending option.

group

public java.util.Map group(java.util.Collection works)
Groups a collection of works.

The grouping and ordering options must be one of the following combinations:

Parameters:
works - Collection of works.
Returns:
An ordered map from grouping objects to array lists of works.

sort

public java.util.List sort(java.util.Collection works)
Sort a collection of works.

Parameters:
works - Collection of works.
Returns:
An ordered map of works.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other object is equal to this one.

The two sets of grouping options are equal if all three of their component options are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.