Class Ret4<A,​B,​C,​D>

  • Type Parameters:
    A - The type of the first member-field ('a').
    B - The type of the second member-field ('b').
    C - The type of the third member-field ('c').
    D - The type of the last member-field ('d').
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class Ret4<A,​B,​C,​D>
    extends RetN
    implements java.io.Serializable, java.lang.Cloneable
    This simple generic-class allows a function to return four 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.
    See Also:
    Serialized Form


    • Field Summary

       
      Serializable ID
      Modifier and Type Field
      protected static long serialVersionUID
       
      Instance Fields
      Modifier and Type Field
      A a
      B b
      C c
      D d
    • Constructor Summary

      Constructors 
      Constructor
      Ret4​(A a, B b, C c, D d)
    • Method Summary

       
      Retrieve Number of Fields in this Class
      Modifier and Type Method
      int n()
       
      Methods: interface java.lang.Cloneable
      Modifier and Type Method
      Ret4<A,​B,​C,​D> clone()
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        🡇    
        protected static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable 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:
         protected static final long serialVersionUID = 1;
        
      • a

        🡅  🡇    
        public final A a
        This holds a pointer the first response object.
        Code:
        Exact Field Declaration Expression:
         public final A a;
        
      • b

        🡅  🡇    
        public final B b
        This holds a pointer to the second response object.
        Code:
        Exact Field Declaration Expression:
         public final B b;
        
      • c

        🡅  🡇    
        public final C c
        This holds a pointer to the third response object.
        Code:
        Exact Field Declaration Expression:
         public final C c;
        
      • d

        🡅  🡇    
        public final D d
        This holds a pointer to the fourth response object.
        Code:
        Exact Field Declaration Expression:
         public final D d;
        
    • Method Detail

      • n

        🡅  🡇    
        public int n()
        Returns '4', indicating how many fields are declared by this class.
        Specified by:
        n in class RetN
        Returns:
        As an instance of Ret4, this method returns '4';
        Code:
        Exact Method Body:
         return 4;
        
      • clone

        🡅    
        public Ret4<A,​B,​C,​Dclone()
        Fulfills Java's interface Cloneable requirements.
        Overrides:
        clone in class java.lang.Object
        Returns:
        A copy of 'this' instance of Ret4.
        Code:
        Exact Method Body:
         return new Ret4<>(this.a, this.b, this.c, this.d);