All Downloads are FREE. Search and download functionalities are using the official Maven repository.

s.filepattern.2.0.6.source-code.Pair Maven / Gradle / Ivy

package filepattern.java;

public class Pair {
    public T first;
    public S second;

    public T get0() {
        return this.first;
    }

    public  S get1() {
        return this.second;
    }

    public void set0(T value) {
        this.first = value;
    }

    public void set1(S value) {
        this.second = value;
    }

    @Override
    public String toString() {
        return "[" + this.first.toString() + ", " + this.second.toString() + "]";
    }

    @Override
    public boolean equals(Object obj) {

        if (obj == this) {
            return true;
        }

        if (!(obj instanceof Pair)) {
            return false;
        }
         
        // typecast o to Complex so that we can compare data members 
        Pair pair = (Pair) obj;

        if ((pair.first.equals(this.first) && pair.second.equals(this.second)) || (pair.first == this.first && pair.second == this.second)) {
            return true;
        } else {
            return false;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy