Package Torello.Java.Additional
Class Ret8<A,B,C,D,E,F,G,H>
- java.lang.Object
-
- Torello.Java.Additional.Ret8<A,B,C,D,E,F,G,H>
-
- Type Parameters:
A
- The type of the first member-field ('a1'
).B
- The type of the second member-field ('b2'
).C
- The type of the third member-field ('c3'
).D
- The type of the fourth member-field ('d4'
).E
- The type of the fifth member-field ('e5'
).F
- The type of the sixth member-field ('f6'
).G
- The type of the seventh member-field ('g7'
).H
- The type of the last member-field ('h8'
).
- All Implemented Interfaces:
java.io.Serializable
public class Ret8<A,B,C,D,E,F,G,H> extends java.lang.Object implements java.io.Serializable
Ret8 - Documentation.
This simple generic-class allows a function to return eight objects as a result, instead of just one. This is not always so useful, and can make code confusing. However there are some instances where the only alternative would be to create an entirely new class/object, when only a single method result would use that object.
ALSO: For the classes Ret6, Ret7 & Ret8 - the variable name includes a number as well, since the letters become progressively more difficult to look at as they increase past "A, B, C, D..."- See Also:
- Serialized Form
Hi-Lited Source-Code:
- View Here: Torello/Java/Additional/Ret8.java
- Open New Browser-Tab: Torello/Java/Additional/Ret8.java
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method String
toString()
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
1
public static final long serialVersionUID = 1;
-
a1
public final A a1
This holds a pointer the first response object.- Code:
- Exact Field Declaration Expression:
1
public final A a1;
-
b2
public final B b2
This holds a pointer to the second response object.- Code:
- Exact Field Declaration Expression:
1
public final B b2;
-
c3
public final C c3
This holds a pointer to the third response object.- Code:
- Exact Field Declaration Expression:
1
public final C c3;
-
d4
public final D d4
This holds a pointer to the fourth response object.- Code:
- Exact Field Declaration Expression:
1
public final D d4;
-
e5
public final E e5
This holds a pointer to the fifth response object.- Code:
- Exact Field Declaration Expression:
1
public final E e5;
-
f6
public final F f6
This holds a pointer to the sixth response object.- Code:
- Exact Field Declaration Expression:
1
public final F f6;
-
g7
public final G g7
This holds a pointer to the seventh response object.- Code:
- Exact Field Declaration Expression:
1
public final G g7;
-
-
Method Detail
-
toString
public java.lang.String toString()
Converts this instance ofRet8
to aString
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- This instance-object as a
String
. - Code:
- Exact Method Body:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
String[] types = new String[8]; types[0] = a1.getClass().getSimpleName(); types[1] = b2.getClass().getSimpleName(); types[2] = c3.getClass().getSimpleName(); types[3] = d4.getClass().getSimpleName(); types[4] = e5.getClass().getSimpleName(); types[5] = f6.getClass().getSimpleName(); types[6] = g7.getClass().getSimpleName(); types[7] = h8.getClass().getSimpleName(); int maxLen = types[0].length(); int len = 0; for (int i=1; i < 8; i++) if ((len = types[i].length()) > maxLen) maxLen = len; maxLen += 2; return "Ret8.a1: " + StringParse.rightSpacePad(types[0], maxLen) + (a1.getClass().isArray() ? RetHelper.toArrayString(a1, types[0]) : RetHelper.indentIfNeeded(a1.toString())) + '\n' + "Ret8.b2: " + StringParse.rightSpacePad(types[1], maxLen) + (b2.getClass().isArray() ? RetHelper.toArrayString(b2, types[1]) : RetHelper.indentIfNeeded(b2.toString())) + '\n' + "Ret8.c3: " + StringParse.rightSpacePad(types[2], maxLen) + (c3.getClass().isArray() ? RetHelper.toArrayString(c3, types[2]) : RetHelper.indentIfNeeded(c3.toString())) + '\n' + "Ret8.d4: " + StringParse.rightSpacePad(types[3], maxLen) + (d4.getClass().isArray() ? RetHelper.toArrayString(d4, types[3]) : RetHelper.indentIfNeeded(d4.toString())) + '\n' + "Ret8.e5: " + StringParse.rightSpacePad(types[4], maxLen) + (e5.getClass().isArray() ? RetHelper.toArrayString(e5, types[4]) : RetHelper.indentIfNeeded(e5.toString())) + '\n' + "Ret8.f6: " + StringParse.rightSpacePad(types[5], maxLen) + (f6.getClass().isArray() ? RetHelper.toArrayString(f6, types[5]) : RetHelper.indentIfNeeded(f6.toString())) + '\n' + "Ret8.g7: " + StringParse.rightSpacePad(types[6], maxLen) + (g7.getClass().isArray() ? RetHelper.toArrayString(g7, types[6]) : RetHelper.indentIfNeeded(g7.toString())) + '\n' + "Ret8.h8: " + StringParse.rightSpacePad(types[7], maxLen) + (h8.getClass().isArray() ? RetHelper.toArrayString(h8, types[7]) : RetHelper.indentIfNeeded(h8.toString()));
-
-