class: PubItemVOComparator

public class: PubItemVOComparator
Author: Peter Broszeit (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 1951 $ $LastChangedDate: 2007-07-09 16:; Complexity: 1
Dates: Created: 16.07.2009 15:13:19; Modified: 16.07.2009 15:13:19;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {13FAD689-8527-4256-9784-5305EEB08678}
The class implements the comparison of two PubItemVOs for the criteria which has to be given in the constructor. Note: this comparator imposes orderings that are inconsistent with equals.
@revised by MuJ: 27.08.2007
 

Goto: Custom Properties, Fields, Methods

See also: Criteria

Appears in: comparator

Connections
 
Custom Properties
 
PubItemVOComparator Attributes
Attribute Details
private Criteria
  criteria
private static const int
  EQUAL
Initial: 0
private static const int
  GREATER
Initial: 1
private static const int
  LESS
Initial: -1
 
PubItemVOComparator Methods
Operation Details
public
compare(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: (non-Javadoc)
@see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
private
compareContextName(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
private
compareCreator(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the creators of two PubItemVOs. Both items must not be null.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareDate(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the dates of two PubItemVOs using the most recent date in the metadata record. Both items must not be null. If no date is given (is null) it is greater than a given date.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareEventTitle(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the titles of the events of two PubItemVOs. Both items must not be null. If no event is given (is null) it is greater than a given event.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareGenre(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the genre of two PubItemVOs.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareModificationDate(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
private
compareOwnerName(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
private
comparePublishingInfo(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the publisher names of the publihing info metadata of two PubItemVOs. Both pubItems must not be null. If no publisher name is given (is null) it is greater than a given publisher name.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareReviewMethod(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This methods compares the review methods of two PubItemVOs. Both items must not be null. If no review type is given (is null) it is greater than a review type .
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareSourceCreator(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the creators of the sources of two PubItemVOs. Both items must not be null. If no source is given (is null) it is greater than a given source.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareSourceTitle(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method is for the comparison of the titles of the sources of two PubItemVOs. Both items must not be null. If no source is given (is null) it is greater than a given source.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
compareState(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
private
compareTitle(
   PubItemVO pubItem1,
   PubItemVO pubItem2):int
Sequential
Notes: This method compares the title metadata of two PubItemVOs. Both pubItems must not be null.
@return 0 if the items are equal, -1 if the first argument is less than the second, 1 otherwise.
private
getCreatorName(
   PubItemVO pubItem):String
Sequential
Notes: Retrieves the creator name of an item. Helper method for compareCreator.
@return The name of the first creator.
private
getDates(
   PubItemVO pubItem):List
Sequential
Notes: Retrieves a list of all dates of an item. Helper method for compareDate.
private
getOwnerName(
   PubItemVO pubItem):String
Sequential
public
PubItemVOComparator(
   Criteria criteria):
Sequential
Notes: Creates a new instance with the given criteria.