Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.content.expression
Class ContentComparator

    java.lang.Object
      com.bea.p13n.content.expression.ContentComparator

All Implemented Interfaces:
  Comparator

public class ContentComparator
extends Object
implements Comparator

A comparator which can sort Content objects.

This will not be very fast since the comparision is done in Java. Try to do sorting in the database.

Field Summary
`protected SortCriteria[]` | `criteria` Deprecated. The SortCriteria this uses.

Constructor Summary
`ContentComparator(SortCriteria[] criteria)` Deprecated. Constructor.
`ContentComparator(String sortBy)` Deprecated. Constructor.

Method Summary
`int` | `compare(Object obj1, Object obj2)` Deprecated. Compare two Content objects based upon the sorting criteria.
`String` | `toString()` Deprecated. Get a string representation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Comparator
`equals`

Field Detail

### criteria

    protected SortCriteria[] criteria

  Deprecated.
  The SortCriteria this uses.

Constructor Detail

### ContentComparator

    public ContentComparator(SortCriteria[] criteria)

  Deprecated.
  Constructor.

### ContentComparator

    public ContentComparator(String sortBy)
                      throws IllegalArgumentException

  Deprecated.
  Constructor.

Throws:
  `IllegalArgumentException` - on invlaid sortBy clause
See Also:
  `SortCriteria.getSortCriteria(java.lang.String)`

Method Detail

### compare

    public int compare(Object obj1,
                       Object obj2)
                throws ClassCastException

  Deprecated.
  Compare two Content objects based upon the sorting criteria.

  Specified by:
    `compare` in interface `Comparator`
  Parameters:
    `obj1` - the first object.
    `obj2` - the second object.
  Returns:
    -1 if obj1 less than obj2, 0 if equals, 1 if greater than.
  Throws:
    `ClassCastException` - thrown if either obj1 or obj2 is not a Content.

### toString

    public String toString()

  Deprecated.
  Get a string representation.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved