Overview | Package | Class | Tree | Deprecated | Index | Help
| bea Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## theory.smart.foundation
Class SmartComparator

    java.lang.Object
      |
      +--theory.smart.foundation.SmartComparator

public class SmartComparator
extends java.lang.Object
implements com.sun.java.util.collections.Comparator, java.io.Serializable

This is an implementation of the Comparator Interface that compares two objects. It is useful when building and searching maps and lists of Business Smart Components (BSC). As an example, all belongings, SmartKeys and SmartHandles are comparable. It uses the singleton pattern

See Also:
  Serialized Form

Method Summary
`int` | `compare(java.lang.Object o1, java.lang.Object o2)` The compare method compares the following types:
`static SmartComparator` | `getInstance()`

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 o1,
                       java.lang.Object o2)

  The compare method compares the following types:

       String
       Comparable

  If the objects neither String or Comparable, then it compares the String representation of the objects. Note: o1 and o2 must be have the same type.
  Specified by:
    compare in interface com.sun.java.util.collections.Comparator
  Parameters:
    `o1` - object 1 to compare
    `o2` - object 2 to compare
  Returns:
    (o1 == o2) ? 0 : (o1 < 02) ? -1 : 1
  Throws:
    java.lang.RuntimeException - if the two objects do have the same type

### getInstance

    public static SmartComparator getInstance()

Overview | Package | Class | Tree | Deprecated | Index | Help
| bea Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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