MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / Quad

Class Quad

src/main/java/field/utility/Quad.java:6–41  ·  view source on GitHub ↗

Created by marc on 3/25/14.

Source from the content-addressed store, hash-verified

4 * Created by marc on 3/25/14.
5 */
6public class Quad<A, B, C, D> extends Triple<A, B, C> {
7 final public D fourth;
8
9 public Quad(A first, B second, C third, D fourth) {
10 super(first, second, third);
11 this.fourth = fourth;
12 }
13
14 @Override
15 public boolean equals(Object o) {
16 if (this == o) return true;
17 if (!(o instanceof Quad)) return false;
18 if (!super.equals(o)) return false;
19
20 Quad quad = (Quad) o;
21
22 return !(fourth != null ? !fourth.equals(quad.fourth) : quad.fourth != null);
23
24 }
25
26 @Override
27 public int hashCode() {
28 int result = super.hashCode();
29 result = 31 * result + (fourth != null ? fourth.hashCode() : 0);
30 return result;
31 }
32
33 public String toString() {
34 return "Quad{" + this.first + "," + this.second + "," + this.third + ","+this.fourth+"}";
35 }
36
37 public Quad<A, B, C, D> duplicate() {
38 return new Quad(this.first instanceof Mutable ? ((Mutable) this.first).duplicate() : this.first, this.second instanceof Mutable ? ((Mutable) this.second).duplicate() : this.second,
39 this.third instanceof Mutable ? ((Mutable) this.third).duplicate() : this.third, this.fourth instanceof Mutable ? ((Mutable) this.fourth).duplicate() : this.fourth);
40 }
41}

Callers 4

writeMethod · 0.85
BrowserClass · 0.85
bracketMethod · 0.85
writeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected