Created a Triple class

This commit is contained in:
DarkGuardsman 2013-07-23 01:45:38 -04:00
parent b52de99572
commit 27acf3287e

View file

@ -0,0 +1,48 @@
package dark.core.helpers;
public class Triple<A, B, C>
{
private final A aaa;
private final B bbb;
private final C ccc;
public Triple(A left, B right, C ccc)
{
this.aaa = left;
this.bbb = right;
this.ccc = ccc;
}
public A getA()
{
return aaa;
}
public B getB()
{
return bbb;
}
public C getC()
{
return ccc;
}
@Override
public int hashCode()
{
return aaa.hashCode() ^ bbb.hashCode() ^ ccc.hashCode();
}
@Override
public boolean equals(Object o)
{
if (o == null)
return false;
if (!(o instanceof Triple))
return false;
Triple pairo = (Triple) o;
return this.aaa.equals(pairo.getA()) && this.bbb.equals(pairo.getB()) && this.ccc.equals(pairo.getC());
}
}