ibis.gmi
Class BinomialCombiner

java.lang.Object
  extended byibis.gmi.BinomialCombiner
All Implemented Interfaces:
java.io.Serializable

public class BinomialCombiner
extends java.lang.Object
implements java.io.Serializable

The BinomialCombiner class serves as a base class for user-defined binomial reply combiners. This class contains methods that can be used to do a pairwise combine of two results. There is a combine method for each result type. The user-defined combiner-class should redefine the combine methods that it will use. This class is not abstract, because the user-defined combiner does not have to supply all "combine" methods (for all different result types). Therefore, default ones are supplied that just throw an exception.

See Also:
Serialized Form

Constructor Summary
BinomialCombiner()
           
 
Method Summary
 boolean combine(int rank1, boolean result1, java.lang.Exception e1, int rank2, boolean result2, java.lang.Exception e2, int size)
          Combiner for boolean results.
 byte combine(int rank1, byte result1, java.lang.Exception e1, int rank2, byte result2, java.lang.Exception e2, int size)
          Combiner for byte results.
 char combine(int rank1, char result1, java.lang.Exception e1, int rank2, char result2, java.lang.Exception e2, int size)
          Combiner for char results.
 double combine(int rank1, double result1, java.lang.Exception e1, int rank2, double result2, java.lang.Exception e2, int size)
          Combiner for double results.
 void combine(int rank1, java.lang.Exception ex1, int rank2, java.lang.Exception ex2, int size)
          Combine method without a result.
 float combine(int rank1, float result1, java.lang.Exception e1, int rank2, float result2, java.lang.Exception e2, int size)
          Combiner for float results.
 int combine(int rank1, int result1, java.lang.Exception e1, int rank2, int result2, java.lang.Exception e2, int size)
          Combiner for int results.
 long combine(int rank1, long result1, java.lang.Exception e1, int rank2, long result2, java.lang.Exception e2, int size)
          Combiner for long results.
 java.lang.Object combine(int rank1, java.lang.Object result1, java.lang.Exception e1, int rank2, java.lang.Object result2, java.lang.Exception e2, int size)
          Combiner for Object results.
 short combine(int rank1, short result1, java.lang.Exception e1, int rank2, short result2, java.lang.Exception e2, int size)
          Combiner for short results.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinomialCombiner

public BinomialCombiner()
Method Detail

combine

public void combine(int rank1,
                    java.lang.Exception ex1,
                    int rank2,
                    java.lang.Exception ex2,
                    int size)
Combine method without a result. Note that if any exception is to be propagated, the combine should throw an exception.

Parameters:
rank1 - rank within the group of the node giving the first result
ex1 - possible exception thrown by node
rank2 - rank within the group of the node giving the second result
ex2 - possible exception thrown by this node
size - total number of results to be combined (the size of the group)

combine

public boolean combine(int rank1,
                       boolean result1,
                       java.lang.Exception e1,
                       int rank2,
                       boolean result2,
                       java.lang.Exception e2,
                       int size)
Combiner for boolean results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public byte combine(int rank1,
                    byte result1,
                    java.lang.Exception e1,
                    int rank2,
                    byte result2,
                    java.lang.Exception e2,
                    int size)
Combiner for byte results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public char combine(int rank1,
                    char result1,
                    java.lang.Exception e1,
                    int rank2,
                    char result2,
                    java.lang.Exception e2,
                    int size)
Combiner for char results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public short combine(int rank1,
                     short result1,
                     java.lang.Exception e1,
                     int rank2,
                     short result2,
                     java.lang.Exception e2,
                     int size)
Combiner for short results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public int combine(int rank1,
                   int result1,
                   java.lang.Exception e1,
                   int rank2,
                   int result2,
                   java.lang.Exception e2,
                   int size)
Combiner for int results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public long combine(int rank1,
                    long result1,
                    java.lang.Exception e1,
                    int rank2,
                    long result2,
                    java.lang.Exception e2,
                    int size)
Combiner for long results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public float combine(int rank1,
                     float result1,
                     java.lang.Exception e1,
                     int rank2,
                     float result2,
                     java.lang.Exception e2,
                     int size)
Combiner for float results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public double combine(int rank1,
                      double result1,
                      java.lang.Exception e1,
                      int rank2,
                      double result2,
                      java.lang.Exception e2,
                      int size)
Combiner for double results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation

combine

public java.lang.Object combine(int rank1,
                                java.lang.Object result1,
                                java.lang.Exception e1,
                                int rank2,
                                java.lang.Object result2,
                                java.lang.Exception e2,
                                int size)
Combiner for Object results.

Parameters:
rank1 - rank of the member that produced the first result
result1 - the first result (if available)
e1 - the first exception (if available)
rank2 - rank of the member that produced the second result
result2 - the second result (if available)
e2 - the first exception (if available)
size - total number of members participating
Returns:
result of the combine operation


The Ibis project