fr.jayasoft.ivy.latest
Class LatestRevisionStrategy

java.lang.Object
  extended byfr.jayasoft.ivy.latest.AbstractLatestStrategy
      extended byfr.jayasoft.ivy.latest.LatestRevisionStrategy
All Implemented Interfaces:
IvyAware, LatestStrategy

public class LatestRevisionStrategy
extends AbstractLatestStrategy


Field Summary
static java.util.Comparator COMPARATOR
          Compares two revisions.
 
Constructor Summary
LatestRevisionStrategy()
           
 
Method Summary
 ArtifactInfo findLatest(ArtifactInfo[] artifacts, java.util.Date date)
          Finds the latest artifact among the given artifacts info.
 
Methods inherited from class fr.jayasoft.ivy.latest.AbstractLatestStrategy
getIvy, getName, setIvy, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPARATOR

public static java.util.Comparator COMPARATOR
Compares two revisions. Revisions are compared using an algorithm inspired by PHP version_compare one, unless a 'latest' revision is found. If the latest revision found is an absolute latest (latest. like), then it is assumed to be the greater. If a partial latest is found, then it is assumed to be greater than any matching fixed revision.

Constructor Detail

LatestRevisionStrategy

public LatestRevisionStrategy()
Method Detail

findLatest

public ArtifactInfo findLatest(ArtifactInfo[] artifacts,
                               java.util.Date date)
Description copied from interface: LatestStrategy
Finds the latest artifact among the given artifacts info. The definition of 'latest' depends on the strategy itself. Given artifacts info are all good candidate. If the given date is not null, then found artifact should not be later than this date.

Parameters:
artifacts -
date -
Returns:
the latest artifact among the given ones.