org.jboss.deployers.plugins.sort
Class DominoOrdering<T extends Domino<?>>

java.lang.Object
  extended by org.jboss.deployers.plugins.sort.DominoOrdering<T>
Type Parameters:
T - exact domino type

public class DominoOrdering<T extends Domino<?>>
extends Object

Simple transition ordering using transitive closure.

Author:
Ales Justin

Nested Class Summary
protected  class DominoOrdering.IndexComparator
          The index comparator.
 
Field Summary
protected  int[][] connections
           
protected  List<T> dominoes
           
protected  String message
           
protected  int size
           
 
Constructor Summary
DominoOrdering(String message)
           
 
Method Summary
protected  void fillCompareNames()
          Fill transitions with name compare.
protected  int fillTransitions(boolean fillTransitions)
          Fill transitions.
protected  void init(List<T> dominoes, Object cause)
          Initialize transitions.
 List<T> orderDominoes(List<T> dominoes, Object cause)
          Order dominoes.
protected  void throwCycleException(Object cause)
          Throw the cycle exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

protected String message

dominoes

protected List<T extends Domino<?>> dominoes

size

protected int size

connections

protected int[][] connections
Constructor Detail

DominoOrdering

public DominoOrdering(String message)
Method Detail

init

protected void init(List<T> dominoes,
                    Object cause)
Initialize transitions.

Parameters:
dominoes - all dominoes
cause - the possible cycle cause

orderDominoes

public List<T> orderDominoes(List<T> dominoes,
                             Object cause)
Order dominoes.

Parameters:
dominoes - all dominoes
cause - the possible cycle cause
Returns:
ordered dominoes list

fillTransitions

protected int fillTransitions(boolean fillTransitions)
Fill transitions.

Parameters:
fillTransitions - do change
Returns:
index of the domino cycle cause, -1 otherwise

fillCompareNames

protected void fillCompareNames()
Fill transitions with name compare.


throwCycleException

protected void throwCycleException(Object cause)
Throw the cycle exception.

Parameters:
cause - the cycle cause


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.