org.apache.ivy.plugins.latest

## Class ComparatorLatestStrategy

- java.lang.Object
- - org.apache.ivy.plugins.latest.AbstractLatestStrategy
  - - org.apache.ivy.plugins.latest.ComparatorLatestStrategy

All Implemented Interfaces:
  LatestStrategy

Direct Known Subclasses:
  LatestLexicographicStrategy, LatestRevisionStrategy, LatestTimeStrategy, OsgiLatestStrategy

    public class ComparatorLatestStrategy
    extends AbstractLatestStrategy

### Constructor Summary

Constructors
Constructor and Description
`ComparatorLatestStrategy()`
`ComparatorLatestStrategy(java.util.Comparator comparator)`

### Method Summary

Methods
`java.util.Comparator` `getComparator()`
`void` `setComparator(java.util.Comparator comparator)`
`java.util.List` `sort(ArtifactInfo[] infos)` Sorts the given artifacts info from the oldest one to the latest one.

### Methods inherited from class org.apache.ivy.plugins.latest.AbstractLatestStrategy

`findLatest, getName, setName, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ComparatorLatestStrategy

    public ComparatorLatestStrategy()

#### ComparatorLatestStrategy

    public ComparatorLatestStrategy(java.util.Comparator comparator)

### Method Detail

#### sort

    public java.util.List sort(ArtifactInfo[] infos)

Description copied from interface: `LatestStrategy`
Sorts the given artifacts info from the oldest one to the latest one. The definition of 'latest' depends on the strategy itself. Given artifacts info are all good candidate.

Returns:

#### getComparator

    public java.util.Comparator getComparator()

#### setComparator

    public void setComparator(java.util.Comparator comparator)