/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hirka;

/**
 *
 * @author dimitri
 */
public class Triplet {
    private int a;
    private int b;
    private int c;
    
    public Triplet(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }
    
    public int get(int num) throws Exception {
        if(num == 0)
            return this.a;
        if(num == 1)
            return this.b;
        if(num == 2)
            return this.c;
        
        throw new Exception("0, 1 ou 2 sinon impossible");
    }
    
    private boolean equivalence(int a, int b, int c) {
        if(this.a == a && this.b == b && this.c == c) {
            return true;
        }
        
        return false;
    }
    
    public boolean estDansTableau(int[][] whereToFind) {
            for (int i = 0; i < whereToFind.length; i++) {
                if(equivalence(whereToFind[i][0], whereToFind[i][1], whereToFind[i][2])) {
                    return true;
                }
            }
        
        return false;
    }
    
}
