001package Torello.Java.Additional;
002
003/**
004 * This simple generic-class allows a function to return <B STYLE='color:red'>seven</B> objects as
005 * a result, instead of just one.   This is not always so useful, and can make code confusing.
006 * However there are some instances where the only alternative would be to create an entirely new
007 * class/object, when only a single method result would use that object.
008 *
009 * <BR /><BR /><B>ALSO: </B> For the classes Ret6, Ret7 &amp; Ret8 - the variable name includes a
010 * number as well, since the letters become progressively more difficult to look at as they
011 * increase past "A, B, C, D..."
012 * 
013 * @param <A1> The type of the <B STYLE='color:red'>first</B> member-field ({@code 'a1'}).
014 * @param <B2> The type of the <B STYLE='color:red'>second</B> member-field ({@code 'b2'}).
015 * @param <C3> The type of the <B STYLE='color:red'>third</B> member-field ({@code 'c3'}).
016 * @param <D4> The type of the <B STYLE='color:red'>fourth</B> member-field ({@code 'd4'}).
017 * @param <E5> The type of the <B STYLE='color:red'>fifth</B> member-field ({@code 'e5'}).
018 * @param <F6> The type of the <B STYLE='color:red'>sixth</B> member-field ({@code 'f6'}).
019 * @param <G7> The type of the <B STYLE='color:red'>last</B> member-field ({@code 'g7'}).
020 */
021public class Ret7<A1, B2, C3, D4, E5, F6, G7>
022    extends RetN
023    implements java.io.Serializable, Cloneable
024{
025    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID>  */
026    protected static final long serialVersionUID = 1;
027
028    /** This holds a pointer the first response object. */
029    public final A1 a1;
030
031    /** This holds a pointer to the second response object. */
032    public final B2 b2;
033
034    /** This holds a pointer to the third response object. */
035    public final C3 c3;
036
037    /** This holds a pointer to the fourth response object. */
038    public final D4 d4;
039
040    /** This holds a pointer to the fifth response object. */
041    public final E5 e5;
042
043    /** This holds a pointer to the sixth response object. */
044    public final F6 f6;
045
046    /** This holds a pointer to the seventh response object. */
047    public final G7 g7;
048
049    /** Constructs this object */
050    public Ret7(A1 a1, B2 b2, C3 c3, D4 d4, E5 e5, F6 f6, G7 g7)
051    {
052        this.a1 = a1;
053        this.b2 = b2;
054        this.c3 = c3;
055        this.d4 = d4;
056        this.e5 = e5;
057        this.f6 = f6;
058        this.g7 = g7;
059    }
060
061    /**
062     * Returns {@code '7'}, indicating how many fields are declared by this class.
063     * 
064     * @return As in instance of {@code Ret7}, this method returns {@code '7'};
065     */
066    public int n() { return 7; }
067
068    // Super-class uses this for toString, equals, and hashCode
069    // There is an optimization, so if this is requested multiple times, it is saved in a
070    // transient field.
071    final Object[] asArrayInternal()
072    { return new Object[] { a1, b2, c3, d4, e5, f6, g7 }; }
073
074
075    /**
076     * Fulfills Java's {@code interface Cloneable} requirements.
077     * 
078     * @return A copy of {@code 'this'} instance of {@code Ret7}.
079     */
080    public Ret7<A1, B2, C3, D4, E5, F6, G7> clone()
081    { return new Ret7<>(this.a1, this.b2, this.c3, this.d4, this.e5, this.f6, this.g7); }
082
083}