org.sonatype.guice.bean.locators
Class DefaultRankingFunction

java.lang.Object
  extended by org.sonatype.guice.bean.locators.DefaultRankingFunction
All Implemented Interfaces:
RankingFunction

public final class DefaultRankingFunction
extends java.lang.Object
implements RankingFunction

Simple RankingFunction that partitions qualified bindings into two main groups.
Default bindings are given zero or positive ranks; the rest are given negative ranks.


Constructor Summary
DefaultRankingFunction()
           
DefaultRankingFunction(int primaryRank)
           
 
Method Summary
 int maxRank()
          Estimates the maximum possible rank for this function; used to arrange injectors in order of ranking probability.
<T> int
rank(com.google.inject.Binding<T> binding)
          Assigns a numeric rank to the given binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRankingFunction

public DefaultRankingFunction(int primaryRank)

DefaultRankingFunction

@Inject
public DefaultRankingFunction()
Method Detail

maxRank

public int maxRank()
Description copied from interface: RankingFunction
Estimates the maximum possible rank for this function; used to arrange injectors in order of ranking probability.

Specified by:
maxRank in interface RankingFunction
Returns:
Maximum rank

rank

public <T> int rank(com.google.inject.Binding<T> binding)
Description copied from interface: RankingFunction
Assigns a numeric rank to the given binding.

Specified by:
rank in interface RankingFunction
Parameters:
binding - The binding
Returns:
Assigned rank


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.