From 7c7d1606c2e78ba984d9b4a644926a42adbf3bf5 Mon Sep 17 00:00:00 2001 From: Kostas Tzoumas Date: Fri, 13 Jun 2014 17:40:24 +0200 Subject: [PATCH 1/3] Shallow copy, deep equality, and hashCode to Tuple classes --- .../stratosphere/api/java/tuple/Tuple1.java | 33 ++++++ .../stratosphere/api/java/tuple/Tuple10.java | 60 ++++++++++ .../stratosphere/api/java/tuple/Tuple11.java | 63 +++++++++++ .../stratosphere/api/java/tuple/Tuple12.java | 66 +++++++++++ .../stratosphere/api/java/tuple/Tuple13.java | 69 ++++++++++++ .../stratosphere/api/java/tuple/Tuple14.java | 72 ++++++++++++ .../stratosphere/api/java/tuple/Tuple15.java | 75 +++++++++++++ .../stratosphere/api/java/tuple/Tuple16.java | 78 +++++++++++++ .../stratosphere/api/java/tuple/Tuple17.java | 81 ++++++++++++++ .../stratosphere/api/java/tuple/Tuple18.java | 84 ++++++++++++++ .../stratosphere/api/java/tuple/Tuple19.java | 87 +++++++++++++++ .../stratosphere/api/java/tuple/Tuple2.java | 36 ++++++ .../stratosphere/api/java/tuple/Tuple20.java | 90 +++++++++++++++ .../stratosphere/api/java/tuple/Tuple21.java | 93 ++++++++++++++++ .../stratosphere/api/java/tuple/Tuple22.java | 96 ++++++++++++++++ .../stratosphere/api/java/tuple/Tuple23.java | 99 +++++++++++++++++ .../stratosphere/api/java/tuple/Tuple24.java | 102 +++++++++++++++++ .../stratosphere/api/java/tuple/Tuple25.java | 105 ++++++++++++++++++ .../stratosphere/api/java/tuple/Tuple3.java | 39 +++++++ .../stratosphere/api/java/tuple/Tuple4.java | 42 +++++++ .../stratosphere/api/java/tuple/Tuple5.java | 45 ++++++++ .../stratosphere/api/java/tuple/Tuple6.java | 48 ++++++++ .../stratosphere/api/java/tuple/Tuple7.java | 51 +++++++++ .../stratosphere/api/java/tuple/Tuple8.java | 54 +++++++++ .../stratosphere/api/java/tuple/Tuple9.java | 57 ++++++++++ .../api/java/tuple/TupleGenerator.java | 67 +++++++++++ 26 files changed, 1792 insertions(+) diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java index 8752dcaf54489..36fbab8a8e075 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java @@ -56,6 +56,15 @@ public Tuple1(T0 value0) { this.f0 = value0; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple1(Tuple1 tuple) { + this( + tuple.f0); + } + @Override public int getArity() { return 1; } @@ -104,4 +113,28 @@ public String toString() { return "(" + StringUtils.arrayAwareToString(this.f0) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple1)) { return false; } + Tuple1 tuple = (Tuple1) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java index 246350d9a08c2..6f96aee094937 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java @@ -101,6 +101,24 @@ public Tuple10(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f9 = value9; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple10(Tuple10 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9); + } + @Override public int getArity() { return 10; } @@ -212,4 +230,46 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f9) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple10)) { return false; } + Tuple10 tuple = (Tuple10) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java index 8bfb6a8b45fcb..47f3001498bb8 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java @@ -106,6 +106,25 @@ public Tuple11(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f10 = value10; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple11(Tuple11 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10); + } + @Override public int getArity() { return 11; } @@ -224,4 +243,48 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f10) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple11)) { return false; } + Tuple11 tuple = (Tuple11) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java index 810af81230dec..395d61ada532d 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java @@ -111,6 +111,26 @@ public Tuple12(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f11 = value11; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple12(Tuple12 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11); + } + @Override public int getArity() { return 12; } @@ -236,4 +256,50 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f11) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple12)) { return false; } + Tuple12 tuple = (Tuple12) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java index c4f4655a6d731..bfc978347dee0 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java @@ -116,6 +116,27 @@ public Tuple13(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f12 = value12; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple13(Tuple13 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12); + } + @Override public int getArity() { return 13; } @@ -248,4 +269,52 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f12) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple13)) { return false; } + Tuple13 tuple = (Tuple13) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java index 737aba6094031..983387b728bd1 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java @@ -121,6 +121,28 @@ public Tuple14(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f13 = value13; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple14(Tuple14 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13); + } + @Override public int getArity() { return 14; } @@ -260,4 +282,54 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f13) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple14)) { return false; } + Tuple14 tuple = (Tuple14) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java index 9cecba7cd4bc1..88338237c52fd 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java @@ -126,6 +126,29 @@ public Tuple15(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f14 = value14; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple15(Tuple15 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14); + } + @Override public int getArity() { return 15; } @@ -272,4 +295,56 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f14) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple15)) { return false; } + Tuple15 tuple = (Tuple15) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java index ce55e3639e7a2..ecf7134feb785 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java @@ -131,6 +131,30 @@ public Tuple16(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f15 = value15; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple16(Tuple16 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15); + } + @Override public int getArity() { return 16; } @@ -284,4 +308,58 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f15) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple16)) { return false; } + Tuple16 tuple = (Tuple16) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java index 58a0c874f7b2b..43389249e98e4 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java @@ -136,6 +136,31 @@ public Tuple17(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f16 = value16; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple17(Tuple17 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16); + } + @Override public int getArity() { return 17; } @@ -296,4 +321,60 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f16) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple17)) { return false; } + Tuple17 tuple = (Tuple17) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java index 6f59431e922ff..6e2fc85dd73dc 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java @@ -141,6 +141,32 @@ public Tuple18(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f17 = value17; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple18(Tuple18 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17); + } + @Override public int getArity() { return 18; } @@ -308,4 +334,62 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f17) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple18)) { return false; } + Tuple18 tuple = (Tuple18) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java index a3ab04dcad41b..0b97c03192516 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java @@ -146,6 +146,33 @@ public Tuple19(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f18 = value18; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple19(Tuple19 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18); + } + @Override public int getArity() { return 19; } @@ -320,4 +347,64 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f18) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple19)) { return false; } + Tuple19 tuple = (Tuple19) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java index ec52f4e415e51..7d65ad545442f 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java @@ -61,6 +61,16 @@ public Tuple2(T0 value0, T1 value1) { this.f1 = value1; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple2(Tuple2 tuple) { + this( + tuple.f0, + tuple.f1); + } + @Override public int getArity() { return 2; } @@ -116,4 +126,30 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f1) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple2)) { return false; } + Tuple2 tuple = (Tuple2) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java index 6b124df9d4aa4..0ff69e43c67f6 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java @@ -151,6 +151,34 @@ public Tuple20(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f19 = value19; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple20(Tuple20 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18, + tuple.f19); + } + @Override public int getArity() { return 20; } @@ -332,4 +360,66 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f19) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple20)) { return false; } + Tuple20 tuple = (Tuple20) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + if (f19 != null ? !f19.equals(tuple.f19) : tuple.f19 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + result = 31 * result + (f19 != null ? f19.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java index 959fce7fd10c6..d4f9ea0ef15c9 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java @@ -156,6 +156,35 @@ public Tuple21(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f20 = value20; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple21(Tuple21 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18, + tuple.f19, + tuple.f20); + } + @Override public int getArity() { return 21; } @@ -344,4 +373,68 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f20) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple21)) { return false; } + Tuple21 tuple = (Tuple21) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + if (f19 != null ? !f19.equals(tuple.f19) : tuple.f19 != null) { return false; } + if (f20 != null ? !f20.equals(tuple.f20) : tuple.f20 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + result = 31 * result + (f19 != null ? f19.hashCode() : 0); + result = 31 * result + (f20 != null ? f20.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java index 5f260836d0040..66a2d9ee8bb62 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java @@ -161,6 +161,36 @@ public Tuple22(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f21 = value21; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple22(Tuple22 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18, + tuple.f19, + tuple.f20, + tuple.f21); + } + @Override public int getArity() { return 22; } @@ -356,4 +386,70 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f21) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple22)) { return false; } + Tuple22 tuple = (Tuple22) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + if (f19 != null ? !f19.equals(tuple.f19) : tuple.f19 != null) { return false; } + if (f20 != null ? !f20.equals(tuple.f20) : tuple.f20 != null) { return false; } + if (f21 != null ? !f21.equals(tuple.f21) : tuple.f21 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + result = 31 * result + (f19 != null ? f19.hashCode() : 0); + result = 31 * result + (f20 != null ? f20.hashCode() : 0); + result = 31 * result + (f21 != null ? f21.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java index 2e4f1458264ef..d1a3e7358d0ad 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java @@ -166,6 +166,37 @@ public Tuple23(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f22 = value22; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple23(Tuple23 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18, + tuple.f19, + tuple.f20, + tuple.f21, + tuple.f22); + } + @Override public int getArity() { return 23; } @@ -368,4 +399,72 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f22) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple23)) { return false; } + Tuple23 tuple = (Tuple23) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + if (f19 != null ? !f19.equals(tuple.f19) : tuple.f19 != null) { return false; } + if (f20 != null ? !f20.equals(tuple.f20) : tuple.f20 != null) { return false; } + if (f21 != null ? !f21.equals(tuple.f21) : tuple.f21 != null) { return false; } + if (f22 != null ? !f22.equals(tuple.f22) : tuple.f22 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + result = 31 * result + (f19 != null ? f19.hashCode() : 0); + result = 31 * result + (f20 != null ? f20.hashCode() : 0); + result = 31 * result + (f21 != null ? f21.hashCode() : 0); + result = 31 * result + (f22 != null ? f22.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java index 8d093217f9826..973ad68d37763 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java @@ -171,6 +171,38 @@ public Tuple24(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f23 = value23; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple24(Tuple24 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18, + tuple.f19, + tuple.f20, + tuple.f21, + tuple.f22, + tuple.f23); + } + @Override public int getArity() { return 24; } @@ -380,4 +412,74 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f23) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple24)) { return false; } + Tuple24 tuple = (Tuple24) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + if (f19 != null ? !f19.equals(tuple.f19) : tuple.f19 != null) { return false; } + if (f20 != null ? !f20.equals(tuple.f20) : tuple.f20 != null) { return false; } + if (f21 != null ? !f21.equals(tuple.f21) : tuple.f21 != null) { return false; } + if (f22 != null ? !f22.equals(tuple.f22) : tuple.f22 != null) { return false; } + if (f23 != null ? !f23.equals(tuple.f23) : tuple.f23 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + result = 31 * result + (f19 != null ? f19.hashCode() : 0); + result = 31 * result + (f20 != null ? f20.hashCode() : 0); + result = 31 * result + (f21 != null ? f21.hashCode() : 0); + result = 31 * result + (f22 != null ? f22.hashCode() : 0); + result = 31 * result + (f23 != null ? f23.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java index 8ebe152525d49..483a9ef36c8a5 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java @@ -176,6 +176,39 @@ public Tuple25(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f24 = value24; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple25(Tuple25 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8, + tuple.f9, + tuple.f10, + tuple.f11, + tuple.f12, + tuple.f13, + tuple.f14, + tuple.f15, + tuple.f16, + tuple.f17, + tuple.f18, + tuple.f19, + tuple.f20, + tuple.f21, + tuple.f22, + tuple.f23, + tuple.f24); + } + @Override public int getArity() { return 25; } @@ -392,4 +425,76 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f24) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple25)) { return false; } + Tuple25 tuple = (Tuple25) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + if (f9 != null ? !f9.equals(tuple.f9) : tuple.f9 != null) { return false; } + if (f10 != null ? !f10.equals(tuple.f10) : tuple.f10 != null) { return false; } + if (f11 != null ? !f11.equals(tuple.f11) : tuple.f11 != null) { return false; } + if (f12 != null ? !f12.equals(tuple.f12) : tuple.f12 != null) { return false; } + if (f13 != null ? !f13.equals(tuple.f13) : tuple.f13 != null) { return false; } + if (f14 != null ? !f14.equals(tuple.f14) : tuple.f14 != null) { return false; } + if (f15 != null ? !f15.equals(tuple.f15) : tuple.f15 != null) { return false; } + if (f16 != null ? !f16.equals(tuple.f16) : tuple.f16 != null) { return false; } + if (f17 != null ? !f17.equals(tuple.f17) : tuple.f17 != null) { return false; } + if (f18 != null ? !f18.equals(tuple.f18) : tuple.f18 != null) { return false; } + if (f19 != null ? !f19.equals(tuple.f19) : tuple.f19 != null) { return false; } + if (f20 != null ? !f20.equals(tuple.f20) : tuple.f20 != null) { return false; } + if (f21 != null ? !f21.equals(tuple.f21) : tuple.f21 != null) { return false; } + if (f22 != null ? !f22.equals(tuple.f22) : tuple.f22 != null) { return false; } + if (f23 != null ? !f23.equals(tuple.f23) : tuple.f23 != null) { return false; } + if (f24 != null ? !f24.equals(tuple.f24) : tuple.f24 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + result = 31 * result + (f9 != null ? f9.hashCode() : 0); + result = 31 * result + (f10 != null ? f10.hashCode() : 0); + result = 31 * result + (f11 != null ? f11.hashCode() : 0); + result = 31 * result + (f12 != null ? f12.hashCode() : 0); + result = 31 * result + (f13 != null ? f13.hashCode() : 0); + result = 31 * result + (f14 != null ? f14.hashCode() : 0); + result = 31 * result + (f15 != null ? f15.hashCode() : 0); + result = 31 * result + (f16 != null ? f16.hashCode() : 0); + result = 31 * result + (f17 != null ? f17.hashCode() : 0); + result = 31 * result + (f18 != null ? f18.hashCode() : 0); + result = 31 * result + (f19 != null ? f19.hashCode() : 0); + result = 31 * result + (f20 != null ? f20.hashCode() : 0); + result = 31 * result + (f21 != null ? f21.hashCode() : 0); + result = 31 * result + (f22 != null ? f22.hashCode() : 0); + result = 31 * result + (f23 != null ? f23.hashCode() : 0); + result = 31 * result + (f24 != null ? f24.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java index 5c2101c522d4d..cdb5cd1fdf825 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java @@ -66,6 +66,17 @@ public Tuple3(T0 value0, T1 value1, T2 value2) { this.f2 = value2; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple3(Tuple3 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2); + } + @Override public int getArity() { return 3; } @@ -128,4 +139,32 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f2) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple3)) { return false; } + Tuple3 tuple = (Tuple3) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java index 135aa8bc3ae0e..59f7bc6998e26 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java @@ -71,6 +71,18 @@ public Tuple4(T0 value0, T1 value1, T2 value2, T3 value3) { this.f3 = value3; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple4(Tuple4 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3); + } + @Override public int getArity() { return 4; } @@ -140,4 +152,34 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f3) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple4)) { return false; } + Tuple4 tuple = (Tuple4) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java index 383fcb428713e..dfd8e20904a7e 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java @@ -76,6 +76,19 @@ public Tuple5(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4) { this.f4 = value4; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple5(Tuple5 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4); + } + @Override public int getArity() { return 5; } @@ -152,4 +165,36 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f4) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple5)) { return false; } + Tuple5 tuple = (Tuple5) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java index 4b7fff47892d5..1ad5241871119 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java @@ -81,6 +81,20 @@ public Tuple6(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) this.f5 = value5; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple6(Tuple6 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5); + } + @Override public int getArity() { return 6; } @@ -164,4 +178,38 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f5) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple6)) { return false; } + Tuple6 tuple = (Tuple6) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java index d017246042595..2e70d19779f93 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java @@ -86,6 +86,21 @@ public Tuple7(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f6 = value6; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple7(Tuple7 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6); + } + @Override public int getArity() { return 7; } @@ -176,4 +191,40 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f6) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple7)) { return false; } + Tuple7 tuple = (Tuple7) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java index 46a96568dc4ee..cc68c146ce9ca 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java @@ -91,6 +91,22 @@ public Tuple8(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f7 = value7; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple8(Tuple8 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7); + } + @Override public int getArity() { return 8; } @@ -188,4 +204,42 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f7) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple8)) { return false; } + Tuple8 tuple = (Tuple8) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java index 5c4b540bb5056..6c423932cfaaa 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java @@ -96,6 +96,23 @@ public Tuple9(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f8 = value8; } + /** + * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. + * @param tuple The tuple that is shallow-copied. + */ + public Tuple9(Tuple9 tuple) { + this( + tuple.f0, + tuple.f1, + tuple.f2, + tuple.f3, + tuple.f4, + tuple.f5, + tuple.f6, + tuple.f7, + tuple.f8); + } + @Override public int getArity() { return 9; } @@ -200,4 +217,44 @@ public String toString() { + ", " + StringUtils.arrayAwareToString(this.f8) + ")"; } + + /** + * Deep equality for tuples by calling equals() on the tuple members + * @param o the object checked for equality + * @return true if this is equal to o. + */ + @Override + public boolean equals(Object o) { + if(this == o) { return true; } + if (!(o instanceof Tuple9)) { return false; } + Tuple9 tuple = (Tuple9) o; + if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { return false; } + if (f1 != null ? !f1.equals(tuple.f1) : tuple.f1 != null) { return false; } + if (f2 != null ? !f2.equals(tuple.f2) : tuple.f2 != null) { return false; } + if (f3 != null ? !f3.equals(tuple.f3) : tuple.f3 != null) { return false; } + if (f4 != null ? !f4.equals(tuple.f4) : tuple.f4 != null) { return false; } + if (f5 != null ? !f5.equals(tuple.f5) : tuple.f5 != null) { return false; } + if (f6 != null ? !f6.equals(tuple.f6) : tuple.f6 != null) { return false; } + if (f7 != null ? !f7.equals(tuple.f7) : tuple.f7 != null) { return false; } + if (f8 != null ? !f8.equals(tuple.f8) : tuple.f8 != null) { return false; } + return true; + } + + /** + * Java Object hash code implementation + * @return Hash code of Tuple object. + */ + @Override + public int hashCode() { + int result = f0 != null ? f0.hashCode() : 0; + result = 31 * result + (f1 != null ? f1.hashCode() : 0); + result = 31 * result + (f2 != null ? f2.hashCode() : 0); + result = 31 * result + (f3 != null ? f3.hashCode() : 0); + result = 31 * result + (f4 != null ? f4.hashCode() : 0); + result = 31 * result + (f5 != null ? f5.hashCode() : 0); + result = 31 * result + (f6 != null ? f6.hashCode() : 0); + result = 31 * result + (f7 != null ? f7.hashCode() : 0); + result = 31 * result + (f8 != null ? f8.hashCode() : 0); + return result; + } } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java index fa1181292adba..49d837d183337 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java @@ -28,6 +28,7 @@ class TupleGenerator { // Parameters for tuple classes + private static final String ROOT_DIRECTORY = "./src/main/java"; private static final String PACKAGE = "eu.stratosphere.api.java.tuple"; @@ -579,6 +580,33 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println("\t}"); w.println(); + + w.println("\t/**"); + w.println("\t* Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter."); + w.println("\t* @param tuple The tuple that is shallow-copied."); + w.println("\t */"); + w.print("\tpublic " + className + "(" + className + "<"); + for (int i = 0; i < numFields; i++) { + w.print ("T" + i); + if (i < numFields - 1) { + w.print (","); + } + } + w.println("> tuple) {"); + + w.println("\t\tthis("); + for (int i = 0; i < numFields; i++) { + String field = "f" + i; + w.print("\t\t\ttuple." + field); + if (i < numFields - 1) { + w.println(","); + } + } + w.println(");"); + w.println("\t}"); + + w.println(); + // arity accessor w.println("\t@Override"); w.println("\tpublic int getArity() { return " + numFields + "; }"); @@ -659,6 +687,45 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println("\t\t\t+ \")\";"); w.println("\t}"); + + + + w.println(); + w.println("\t/**"); + w.println("\t * Deep equality for tuples by calling equals() on the tuple members"); + w.println("\t * @param o the object checked for equality"); + w.println("\t * @return true if this is equal to o."); + w.println("\t */"); + w.println("\t@Override"); + w.println("\tpublic boolean equals(Object o) {"); + w.println("\t\tif(this == o) { return true; }"); + w.println("\t\tif (!(o instanceof " + className + ")) { return false; }"); + w.println("\t\t" + className + " tuple = (" + className + ") o;"); + for (int i = 0; i < numFields; i++) { + String field = "f" + i; + w.println("\t\tif (" + field + " != null ? !" + field +".equals(tuple." + + field + ") : tuple." + field + " != null) { return false; }"); + } + w.println("\t\treturn true;"); + w.println("\t}"); + + w.println(); + w.println("\t/**"); + w.println("\t * Java Object hash code implementation"); + w.println("\t * @return Hash code of Tuple object."); + w.println("\t */"); + w.println("\t@Override"); + w.println("\tpublic int hashCode() {"); + w.println("\t\tint result = f0 != null ? f0.hashCode() : 0;"); + for (int i = 1; i < numFields; i++) { + String field = "f" + i; + w.println("\t\tresult = 31 * result + (" + field + " != null ? " + field + ".hashCode() : 0);"); + } + w.println("\t\treturn result;"); + w.println("\t}"); + + + // foot w.println("}"); } From 4c0a0a829670e13eeffe050eca35ea2083343ec8 Mon Sep 17 00:00:00 2001 From: Kostas Tzoumas Date: Tue, 17 Jun 2014 15:12:22 +0200 Subject: [PATCH 2/3] Write shallow copy method, made copy constructor private --- .../stratosphere/api/java/tuple/Tuple1.java | 17 ++++--- .../stratosphere/api/java/tuple/Tuple10.java | 26 +++++++--- .../stratosphere/api/java/tuple/Tuple11.java | 27 +++++++--- .../stratosphere/api/java/tuple/Tuple12.java | 28 ++++++++--- .../stratosphere/api/java/tuple/Tuple13.java | 29 ++++++++--- .../stratosphere/api/java/tuple/Tuple14.java | 30 +++++++++--- .../stratosphere/api/java/tuple/Tuple15.java | 31 +++++++++--- .../stratosphere/api/java/tuple/Tuple16.java | 32 +++++++++--- .../stratosphere/api/java/tuple/Tuple17.java | 33 ++++++++++--- .../stratosphere/api/java/tuple/Tuple18.java | 34 ++++++++++--- .../stratosphere/api/java/tuple/Tuple19.java | 35 ++++++++++--- .../stratosphere/api/java/tuple/Tuple2.java | 18 ++++--- .../stratosphere/api/java/tuple/Tuple20.java | 36 +++++++++++--- .../stratosphere/api/java/tuple/Tuple21.java | 37 +++++++++++--- .../stratosphere/api/java/tuple/Tuple22.java | 38 +++++++++++--- .../stratosphere/api/java/tuple/Tuple23.java | 39 ++++++++++++--- .../stratosphere/api/java/tuple/Tuple24.java | 40 ++++++++++++--- .../stratosphere/api/java/tuple/Tuple25.java | 41 +++++++++++++--- .../stratosphere/api/java/tuple/Tuple3.java | 19 ++++--- .../stratosphere/api/java/tuple/Tuple4.java | 20 +++++--- .../stratosphere/api/java/tuple/Tuple5.java | 21 +++++--- .../stratosphere/api/java/tuple/Tuple6.java | 22 ++++++--- .../stratosphere/api/java/tuple/Tuple7.java | 23 ++++++--- .../stratosphere/api/java/tuple/Tuple8.java | 24 ++++++--- .../stratosphere/api/java/tuple/Tuple9.java | 25 +++++++--- .../api/java/tuple/TupleGenerator.java | 49 +++++++++++++++---- 26 files changed, 590 insertions(+), 184 deletions(-) diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java index 36fbab8a8e075..514daa7ad1a48 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java @@ -60,9 +60,8 @@ public Tuple1(T0 value0) { * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple1(Tuple1 tuple) { - this( - tuple.f0); + private Tuple1(Tuple1 tuple) { + this(tuple.f0); } @Override @@ -128,13 +127,17 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple1 copy(){ + return new Tuple1(this.f0); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java index 6f96aee094937..7c2443878083d 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java @@ -105,9 +105,8 @@ public Tuple10(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple10(Tuple10 tuple) { - this( - tuple.f0, + private Tuple10(Tuple10 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -254,10 +253,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -272,4 +267,21 @@ public int hashCode() { result = 31 * result + (f9 != null ? f9.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple10 copy(){ + return new Tuple10(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java index 47f3001498bb8..868538c13852b 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java @@ -110,9 +110,8 @@ public Tuple11(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple11(Tuple11 tuple) { - this( - tuple.f0, + private Tuple11(Tuple11 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -268,10 +267,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -287,4 +282,22 @@ public int hashCode() { result = 31 * result + (f10 != null ? f10.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple11 copy(){ + return new Tuple11(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java index 395d61ada532d..694cb95f9ba3a 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java @@ -115,9 +115,8 @@ public Tuple12(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple12(Tuple12 tuple) { - this( - tuple.f0, + private Tuple12(Tuple12 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -282,10 +281,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -302,4 +297,23 @@ public int hashCode() { result = 31 * result + (f11 != null ? f11.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple12 copy(){ + return new Tuple12(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java index bfc978347dee0..4727623de6699 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java @@ -120,9 +120,8 @@ public Tuple13(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple13(Tuple13 tuple) { - this( - tuple.f0, + private Tuple13(Tuple13 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -296,10 +295,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -317,4 +312,24 @@ public int hashCode() { result = 31 * result + (f12 != null ? f12.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple13 copy(){ + return new Tuple13(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java index 983387b728bd1..3dfe32ff75b87 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java @@ -125,9 +125,8 @@ public Tuple14(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple14(Tuple14 tuple) { - this( - tuple.f0, + private Tuple14(Tuple14 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -310,10 +309,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -332,4 +327,25 @@ public int hashCode() { result = 31 * result + (f13 != null ? f13.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple14 copy(){ + return new Tuple14(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java index 88338237c52fd..668c0a9f6f2ff 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java @@ -130,9 +130,8 @@ public Tuple15(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple15(Tuple15 tuple) { - this( - tuple.f0, + private Tuple15(Tuple15 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -324,10 +323,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -347,4 +342,26 @@ public int hashCode() { result = 31 * result + (f14 != null ? f14.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple15 copy(){ + return new Tuple15(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java index ecf7134feb785..3f72590724594 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java @@ -135,9 +135,8 @@ public Tuple16(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple16(Tuple16 tuple) { - this( - tuple.f0, + private Tuple16(Tuple16 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -338,10 +337,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -362,4 +357,27 @@ public int hashCode() { result = 31 * result + (f15 != null ? f15.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple16 copy(){ + return new Tuple16(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java index 43389249e98e4..aa728daa6b4ef 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java @@ -140,9 +140,8 @@ public Tuple17(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple17(Tuple17 tuple) { - this( - tuple.f0, + private Tuple17(Tuple17 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -352,10 +351,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -377,4 +372,28 @@ public int hashCode() { result = 31 * result + (f16 != null ? f16.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple17 copy(){ + return new Tuple17(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java index 6e2fc85dd73dc..a33919a867188 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java @@ -145,9 +145,8 @@ public Tuple18(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple18(Tuple18 tuple) { - this( - tuple.f0, + private Tuple18(Tuple18 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -366,10 +365,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -392,4 +387,29 @@ public int hashCode() { result = 31 * result + (f17 != null ? f17.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple18 copy(){ + return new Tuple18(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java index 0b97c03192516..c13d4cc88670a 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java @@ -150,9 +150,8 @@ public Tuple19(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple19(Tuple19 tuple) { - this( - tuple.f0, + private Tuple19(Tuple19 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -380,10 +379,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -407,4 +402,30 @@ public int hashCode() { result = 31 * result + (f18 != null ? f18.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple19 copy(){ + return new Tuple19(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java index 7d65ad545442f..ef2db53cdb89c 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java @@ -65,9 +65,8 @@ public Tuple2(T0 value0, T1 value1) { * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple2(Tuple2 tuple) { - this( - tuple.f0, + private Tuple2(Tuple2 tuple) { + this(tuple.f0, tuple.f1); } @@ -142,14 +141,19 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; result = 31 * result + (f1 != null ? f1.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple2 copy(){ + return new Tuple2(this.f0, + this.f1); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java index 0ff69e43c67f6..e27c3ff4f0a9f 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java @@ -155,9 +155,8 @@ public Tuple20(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple20(Tuple20 tuple) { - this( - tuple.f0, + private Tuple20(Tuple20 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -394,10 +393,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -422,4 +417,31 @@ public int hashCode() { result = 31 * result + (f19 != null ? f19.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple20 copy(){ + return new Tuple20(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18, + this.f19); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java index d4f9ea0ef15c9..5c5cbf1fa9dda 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java @@ -160,9 +160,8 @@ public Tuple21(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple21(Tuple21 tuple) { - this( - tuple.f0, + private Tuple21(Tuple21 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -408,10 +407,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -437,4 +432,32 @@ public int hashCode() { result = 31 * result + (f20 != null ? f20.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple21 copy(){ + return new Tuple21(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18, + this.f19, + this.f20); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java index 66a2d9ee8bb62..2a5e994fa3617 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java @@ -165,9 +165,8 @@ public Tuple22(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple22(Tuple22 tuple) { - this( - tuple.f0, + private Tuple22(Tuple22 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -422,10 +421,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -452,4 +447,33 @@ public int hashCode() { result = 31 * result + (f21 != null ? f21.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple22 copy(){ + return new Tuple22(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18, + this.f19, + this.f20, + this.f21); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java index d1a3e7358d0ad..6526b9f4302c3 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java @@ -170,9 +170,8 @@ public Tuple23(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple23(Tuple23 tuple) { - this( - tuple.f0, + private Tuple23(Tuple23 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -436,10 +435,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -467,4 +462,34 @@ public int hashCode() { result = 31 * result + (f22 != null ? f22.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple23 copy(){ + return new Tuple23(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18, + this.f19, + this.f20, + this.f21, + this.f22); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java index 973ad68d37763..398c7b7cb37cb 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java @@ -175,9 +175,8 @@ public Tuple24(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple24(Tuple24 tuple) { - this( - tuple.f0, + private Tuple24(Tuple24 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -450,10 +449,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -482,4 +477,35 @@ public int hashCode() { result = 31 * result + (f23 != null ? f23.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple24 copy(){ + return new Tuple24(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18, + this.f19, + this.f20, + this.f21, + this.f22, + this.f23); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java index 483a9ef36c8a5..8d84d36dff0b1 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java @@ -180,9 +180,8 @@ public Tuple25(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple25(Tuple25 tuple) { - this( - tuple.f0, + private Tuple25(Tuple25 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -464,10 +463,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -497,4 +492,36 @@ public int hashCode() { result = 31 * result + (f24 != null ? f24.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple25 copy(){ + return new Tuple25(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8, + this.f9, + this.f10, + this.f11, + this.f12, + this.f13, + this.f14, + this.f15, + this.f16, + this.f17, + this.f18, + this.f19, + this.f20, + this.f21, + this.f22, + this.f23, + this.f24); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java index cdb5cd1fdf825..6caf050b0af97 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java @@ -70,9 +70,8 @@ public Tuple3(T0 value0, T1 value1, T2 value2) { * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple3(Tuple3 tuple) { - this( - tuple.f0, + private Tuple3(Tuple3 tuple) { + this(tuple.f0, tuple.f1, tuple.f2); } @@ -156,10 +155,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -167,4 +162,14 @@ public int hashCode() { result = 31 * result + (f2 != null ? f2.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple3 copy(){ + return new Tuple3(this.f0, + this.f1, + this.f2); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java index 59f7bc6998e26..5b80f147e9c05 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java @@ -75,9 +75,8 @@ public Tuple4(T0 value0, T1 value1, T2 value2, T3 value3) { * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple4(Tuple4 tuple) { - this( - tuple.f0, + private Tuple4(Tuple4 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3); @@ -170,10 +169,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -182,4 +177,15 @@ public int hashCode() { result = 31 * result + (f3 != null ? f3.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple4 copy(){ + return new Tuple4(this.f0, + this.f1, + this.f2, + this.f3); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java index dfd8e20904a7e..945078bca6301 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java @@ -80,9 +80,8 @@ public Tuple5(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4) { * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple5(Tuple5 tuple) { - this( - tuple.f0, + private Tuple5(Tuple5 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -184,10 +183,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -197,4 +192,16 @@ public int hashCode() { result = 31 * result + (f4 != null ? f4.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple5 copy(){ + return new Tuple5(this.f0, + this.f1, + this.f2, + this.f3, + this.f4); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java index 1ad5241871119..756837e9dc0f1 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java @@ -85,9 +85,8 @@ public Tuple6(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple6(Tuple6 tuple) { - this( - tuple.f0, + private Tuple6(Tuple6 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -198,10 +197,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -212,4 +207,17 @@ public int hashCode() { result = 31 * result + (f5 != null ? f5.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple6 copy(){ + return new Tuple6(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java index 2e70d19779f93..ccb4ce557ca5e 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java @@ -90,9 +90,8 @@ public Tuple7(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple7(Tuple7 tuple) { - this( - tuple.f0, + private Tuple7(Tuple7 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -212,10 +211,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -227,4 +222,18 @@ public int hashCode() { result = 31 * result + (f6 != null ? f6.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple7 copy(){ + return new Tuple7(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java index cc68c146ce9ca..dbb10be4e8047 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java @@ -95,9 +95,8 @@ public Tuple8(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple8(Tuple8 tuple) { - this( - tuple.f0, + private Tuple8(Tuple8 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -226,10 +225,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -242,4 +237,19 @@ public int hashCode() { result = 31 * result + (f7 != null ? f7.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple8 copy(){ + return new Tuple8(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java index 6c423932cfaaa..38a0048dee11e 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java @@ -100,9 +100,8 @@ public Tuple9(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. * @param tuple The tuple that is shallow-copied. */ - public Tuple9(Tuple9 tuple) { - this( - tuple.f0, + private Tuple9(Tuple9 tuple) { + this(tuple.f0, tuple.f1, tuple.f2, tuple.f3, @@ -240,10 +239,6 @@ public boolean equals(Object o) { return true; } - /** - * Java Object hash code implementation - * @return Hash code of Tuple object. - */ @Override public int hashCode() { int result = f0 != null ? f0.hashCode() : 0; @@ -257,4 +252,20 @@ public int hashCode() { result = 31 * result + (f8 != null ? f8.hashCode() : 0); return result; } + /** + * Shallow tuple copy. + * @returns A new Tuple with the same fields as this. + */ + public Tuple9 copy(){ + return new Tuple9(this.f0, + this.f1, + this.f2, + this.f3, + this.f4, + this.f5, + this.f6, + this.f7, + this.f8); + } + } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java index 49d837d183337..a4e7bc3eef6ed 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java @@ -499,7 +499,7 @@ private static void createTupleClasses(File root) throws FileNotFoundException { for (int i = FIRST; i <= LAST; i++) { File tupleFile = new File(dir, "Tuple" + i + ".java"); - PrintWriter writer = new PrintWriter(tupleFile); + PrintWriter writer = new PrintWriter(tupleFile); writeTupleClass(writer, i); writer.flush(); writer.close(); @@ -585,7 +585,7 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println("\t* Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter."); w.println("\t* @param tuple The tuple that is shallow-copied."); w.println("\t */"); - w.print("\tpublic " + className + "(" + className + "<"); + w.print("\tprivate " + className + "(" + className + "<"); for (int i = 0; i < numFields; i++) { w.print ("T" + i); if (i < numFields - 1) { @@ -594,8 +594,12 @@ private static void writeTupleClass(PrintWriter w, int numFields) { } w.println("> tuple) {"); - w.println("\t\tthis("); - for (int i = 0; i < numFields; i++) { + w.print("\t\tthis("); + w.print("tuple.f0"); + if (numFields > 1) { + w.println(","); + } + for (int i = 1; i < numFields; i++) { String field = "f" + i; w.print("\t\t\ttuple." + field); if (i < numFields - 1) { @@ -662,7 +666,7 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println("\t}"); w.println(); - // standard utilities (toString, equals, hashCode) + // standard utilities (toString, equals, hashCode, copy) w.println(); w.println("\t// -------------------------------------------------------------------------------------------------"); w.println("\t// standard utilities"); @@ -710,10 +714,6 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println("\t}"); w.println(); - w.println("\t/**"); - w.println("\t * Java Object hash code implementation"); - w.println("\t * @return Hash code of Tuple object."); - w.println("\t */"); w.println("\t@Override"); w.println("\tpublic int hashCode() {"); w.println("\t\tint result = f0 != null ? f0.hashCode() : 0;"); @@ -725,6 +725,37 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println("\t}"); + String tupleTypes = "<"; + for (int i = 0; i < numFields; i++) { + tupleTypes += "T" + i; + if (i < numFields - 1) { + tupleTypes += ","; + } + } + tupleTypes += ">"; + + w.println("\t/**"); + w.println("\t* Shallow tuple copy."); + w.println("\t* @returns A new Tuple with the same fields as this."); + w.println("\t */"); + w.println("\tpublic " + className + tupleTypes + " copy(){ "); + + w.print("\t\treturn new " + className + tupleTypes + "(this.f0"); + if (numFields > 1) { + w.println(","); + } + for (int i = 1; i < numFields; i++) { + String field = "f" + i; + w.print("\t\t\tthis." + field); + if (i < numFields - 1) { + w.println(","); + } + } + w.println(");"); + w.println("\t}"); + + w.println(); + // foot w.println("}"); From 769b5fb0ce22ba229cc34b59b3b3f11ca61c18bc Mon Sep 17 00:00:00 2001 From: Kostas Tzoumas Date: Mon, 23 Jun 2014 16:48:39 +0200 Subject: [PATCH 3/3] Deleted private copy constructor --- .../stratosphere/api/java/tuple/Tuple1.java | 8 ----- .../stratosphere/api/java/tuple/Tuple10.java | 17 ---------- .../stratosphere/api/java/tuple/Tuple11.java | 18 ----------- .../stratosphere/api/java/tuple/Tuple12.java | 19 ----------- .../stratosphere/api/java/tuple/Tuple13.java | 20 ------------ .../stratosphere/api/java/tuple/Tuple14.java | 21 ------------ .../stratosphere/api/java/tuple/Tuple15.java | 22 ------------- .../stratosphere/api/java/tuple/Tuple16.java | 23 ------------- .../stratosphere/api/java/tuple/Tuple17.java | 24 -------------- .../stratosphere/api/java/tuple/Tuple18.java | 25 --------------- .../stratosphere/api/java/tuple/Tuple19.java | 26 --------------- .../stratosphere/api/java/tuple/Tuple2.java | 9 ------ .../stratosphere/api/java/tuple/Tuple20.java | 27 ---------------- .../stratosphere/api/java/tuple/Tuple21.java | 28 ---------------- .../stratosphere/api/java/tuple/Tuple22.java | 29 ----------------- .../stratosphere/api/java/tuple/Tuple23.java | 30 ----------------- .../stratosphere/api/java/tuple/Tuple24.java | 31 ------------------ .../stratosphere/api/java/tuple/Tuple25.java | 32 ------------------- .../stratosphere/api/java/tuple/Tuple3.java | 10 ------ .../stratosphere/api/java/tuple/Tuple4.java | 11 ------- .../stratosphere/api/java/tuple/Tuple5.java | 12 ------- .../stratosphere/api/java/tuple/Tuple6.java | 13 -------- .../stratosphere/api/java/tuple/Tuple7.java | 14 -------- .../stratosphere/api/java/tuple/Tuple8.java | 15 --------- .../stratosphere/api/java/tuple/Tuple9.java | 16 ---------- .../api/java/tuple/TupleGenerator.java | 30 ----------------- 26 files changed, 530 deletions(-) diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java index 514daa7ad1a48..66be6172f38f0 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple1.java @@ -56,14 +56,6 @@ public Tuple1(T0 value0) { this.f0 = value0; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple1(Tuple1 tuple) { - this(tuple.f0); - } - @Override public int getArity() { return 1; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java index 7c2443878083d..3a8ffd95a4b37 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple10.java @@ -101,23 +101,6 @@ public Tuple10(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f9 = value9; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple10(Tuple10 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9); - } - @Override public int getArity() { return 10; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java index 868538c13852b..9cafa329d7cd1 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple11.java @@ -106,24 +106,6 @@ public Tuple11(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f10 = value10; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple11(Tuple11 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10); - } - @Override public int getArity() { return 11; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java index 694cb95f9ba3a..81204a9890fe3 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple12.java @@ -111,25 +111,6 @@ public Tuple12(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f11 = value11; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple12(Tuple12 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11); - } - @Override public int getArity() { return 12; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java index 4727623de6699..5a4b02a9155bb 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple13.java @@ -116,26 +116,6 @@ public Tuple13(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f12 = value12; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple13(Tuple13 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12); - } - @Override public int getArity() { return 13; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java index 3dfe32ff75b87..205e0b4ba264e 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple14.java @@ -121,27 +121,6 @@ public Tuple14(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f13 = value13; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple14(Tuple14 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13); - } - @Override public int getArity() { return 14; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java index 668c0a9f6f2ff..6ffaa4e306126 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple15.java @@ -126,28 +126,6 @@ public Tuple15(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f14 = value14; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple15(Tuple15 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14); - } - @Override public int getArity() { return 15; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java index 3f72590724594..ed4b67dec0239 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple16.java @@ -131,29 +131,6 @@ public Tuple16(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f15 = value15; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple16(Tuple16 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15); - } - @Override public int getArity() { return 16; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java index aa728daa6b4ef..68760f5af8617 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple17.java @@ -136,30 +136,6 @@ public Tuple17(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f16 = value16; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple17(Tuple17 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16); - } - @Override public int getArity() { return 17; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java index a33919a867188..33ac5d971173b 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple18.java @@ -141,31 +141,6 @@ public Tuple18(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f17 = value17; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple18(Tuple18 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17); - } - @Override public int getArity() { return 18; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java index c13d4cc88670a..4419ca3f645c6 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple19.java @@ -146,32 +146,6 @@ public Tuple19(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f18 = value18; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple19(Tuple19 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18); - } - @Override public int getArity() { return 19; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java index ef2db53cdb89c..d1755112272b5 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple2.java @@ -61,15 +61,6 @@ public Tuple2(T0 value0, T1 value1) { this.f1 = value1; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple2(Tuple2 tuple) { - this(tuple.f0, - tuple.f1); - } - @Override public int getArity() { return 2; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java index e27c3ff4f0a9f..ce6c03e705f07 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple20.java @@ -151,33 +151,6 @@ public Tuple20(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f19 = value19; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple20(Tuple20 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18, - tuple.f19); - } - @Override public int getArity() { return 20; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java index 5c5cbf1fa9dda..7995ceda0365c 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple21.java @@ -156,34 +156,6 @@ public Tuple21(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f20 = value20; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple21(Tuple21 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18, - tuple.f19, - tuple.f20); - } - @Override public int getArity() { return 21; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java index 2a5e994fa3617..060f1585d7aef 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple22.java @@ -161,35 +161,6 @@ public Tuple22(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f21 = value21; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple22(Tuple22 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18, - tuple.f19, - tuple.f20, - tuple.f21); - } - @Override public int getArity() { return 22; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java index 6526b9f4302c3..191002473ccc5 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple23.java @@ -166,36 +166,6 @@ public Tuple23(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f22 = value22; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple23(Tuple23 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18, - tuple.f19, - tuple.f20, - tuple.f21, - tuple.f22); - } - @Override public int getArity() { return 23; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java index 398c7b7cb37cb..8ed94381f0709 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple24.java @@ -171,37 +171,6 @@ public Tuple24(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f23 = value23; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple24(Tuple24 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18, - tuple.f19, - tuple.f20, - tuple.f21, - tuple.f22, - tuple.f23); - } - @Override public int getArity() { return 24; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java index 8d84d36dff0b1..cf0fcdd56b8da 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple25.java @@ -176,38 +176,6 @@ public Tuple25(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f24 = value24; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple25(Tuple25 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8, - tuple.f9, - tuple.f10, - tuple.f11, - tuple.f12, - tuple.f13, - tuple.f14, - tuple.f15, - tuple.f16, - tuple.f17, - tuple.f18, - tuple.f19, - tuple.f20, - tuple.f21, - tuple.f22, - tuple.f23, - tuple.f24); - } - @Override public int getArity() { return 25; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java index 6caf050b0af97..aa6aff92c49bd 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple3.java @@ -66,16 +66,6 @@ public Tuple3(T0 value0, T1 value1, T2 value2) { this.f2 = value2; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple3(Tuple3 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2); - } - @Override public int getArity() { return 3; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java index 5b80f147e9c05..3c165b003a652 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple4.java @@ -71,17 +71,6 @@ public Tuple4(T0 value0, T1 value1, T2 value2, T3 value3) { this.f3 = value3; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple4(Tuple4 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3); - } - @Override public int getArity() { return 4; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java index 945078bca6301..17d3ec77f8375 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple5.java @@ -76,18 +76,6 @@ public Tuple5(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4) { this.f4 = value4; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple5(Tuple5 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4); - } - @Override public int getArity() { return 5; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java index 756837e9dc0f1..0f519aa5c764c 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple6.java @@ -81,19 +81,6 @@ public Tuple6(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) this.f5 = value5; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple6(Tuple6 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5); - } - @Override public int getArity() { return 6; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java index ccb4ce557ca5e..1572083ebe75f 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple7.java @@ -86,20 +86,6 @@ public Tuple7(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f6 = value6; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple7(Tuple7 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6); - } - @Override public int getArity() { return 7; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java index dbb10be4e8047..b4fe194aa960a 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple8.java @@ -91,21 +91,6 @@ public Tuple8(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f7 = value7; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple8(Tuple8 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7); - } - @Override public int getArity() { return 8; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java index 38a0048dee11e..0a1ce0be9795f 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/Tuple9.java @@ -96,22 +96,6 @@ public Tuple9(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, this.f8 = value8; } - /** - * Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter. - * @param tuple The tuple that is shallow-copied. - */ - private Tuple9(Tuple9 tuple) { - this(tuple.f0, - tuple.f1, - tuple.f2, - tuple.f3, - tuple.f4, - tuple.f5, - tuple.f6, - tuple.f7, - tuple.f8); - } - @Override public int getArity() { return 9; } diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java index a4e7bc3eef6ed..08e5cd3df66bc 100644 --- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java +++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/tuple/TupleGenerator.java @@ -581,36 +581,6 @@ private static void writeTupleClass(PrintWriter w, int numFields) { w.println(); - w.println("\t/**"); - w.println("\t* Copy constructor. Creates a new tuple and assigns the fields to the fields of the method parameter."); - w.println("\t* @param tuple The tuple that is shallow-copied."); - w.println("\t */"); - w.print("\tprivate " + className + "(" + className + "<"); - for (int i = 0; i < numFields; i++) { - w.print ("T" + i); - if (i < numFields - 1) { - w.print (","); - } - } - w.println("> tuple) {"); - - w.print("\t\tthis("); - w.print("tuple.f0"); - if (numFields > 1) { - w.println(","); - } - for (int i = 1; i < numFields; i++) { - String field = "f" + i; - w.print("\t\t\ttuple." + field); - if (i < numFields - 1) { - w.println(","); - } - } - w.println(");"); - w.println("\t}"); - - w.println(); - // arity accessor w.println("\t@Override"); w.println("\tpublic int getArity() { return " + numFields + "; }");