ibis.gmi
Class BinomialCombiner

java.lang.Object
  extended by ibis.gmi.BinomialCombiner
All Implemented Interfaces:
Serializable

public class BinomialCombiner
extends Object
implements 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

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

Method Detail

combine

public void combine(int rank1,
                    Exception ex1,
                    int rank2,
                    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,
                       Exception e1,
                       int rank2,
                       boolean result2,
                       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,
                    Exception e1,
                    int rank2,
                    byte result2,
                    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,
                    Exception e1,
                    int rank2,
                    char result2,
                    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,
                     Exception e1,
                     int rank2,
                     short result2,
                     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,
                   Exception e1,
                   int rank2,
                   int result2,
                   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,
                    Exception e1,
                    int rank2,
                    long result2,
                    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,
                     Exception e1,
                     int rank2,
                     float result2,
                     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,
                      Exception e1,
                      int rank2,
                      double result2,
                      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 Object combine(int rank1,
                      Object result1,
                      Exception e1,
                      int rank2,
                      Object result2,
                      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