bea Systems, Inc.

theory.smart.ebusiness.shoppingadvisor
Class ItemByDegreeItemComparator

java.lang.Object
  |
  +--theory.smart.ebusiness.shoppingadvisor.ItemByDegreeItemComparator

public class ItemByDegreeItemComparator
extends java.lang.Object
implements com.sun.java.util.collections.Comparator

Compares two ItemByDegree by obtaining their items and comparing the items' primary keys.

See Also:
ItemByDegree, Item

Method Summary
 int compare(java.lang.Object arg1, java.lang.Object arg2)
          Compares two ItemByDegree
static ItemByDegreeItemComparator getInstance()
          A caching mechanism to improve the performance while instantiating ItemByDegreeItemComparators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compare

public int compare(java.lang.Object arg1,
                   java.lang.Object arg2)
Compares two ItemByDegree
Specified by:
compare in interface com.sun.java.util.collections.Comparator
Returns:
arg1.getItem().getPrimaryKey().compareTo( arg2.getItem().getPrimaryKey())

getInstance

public static ItemByDegreeItemComparator getInstance()
A caching mechanism to improve the performance while instantiating ItemByDegreeItemComparators
Returns:
a new instance if no instance exists or an existing instance

bea Systems, Inc.

© Copyright 2000 bea Systems, Inc. All rights reserved.