Class Triple<L,M,R>

java.lang.Object
com.github.tadukoo.util.tuple.Triple<L,M,R>
Type Parameters:
L - The left item type
M - The middle item type
R - The right item type

public class Triple<L,M,R> extends Object
A tuple class for holding 3 items of specified type.
Version:
0.1-Alpha-SNAPSHOT
Author:
Logan Ferree (Tadukoo)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private L
    The left item in the tuple
    private M
    The middle item in the tuple
    private R
    The right item in the tuple
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Triple(L left, M middle, R right)
    Constructs a Triple of the three given objects.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    static <L, M, R> Triple<L,M,R>
    of(L left, M middle, R right)
    Constructs a Triple of the three given objects.
    void
    setLeft(L left)
    Sets the left item of the Triple
    void
    setMiddle(M middle)
    Sets the middle item of the Triple
    void
    setRight(R right)
    Sets the right item of the Triple
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • left

      private L left
      The left item in the tuple
    • middle

      private M middle
      The middle item in the tuple
  • Constructor Details

    • Triple

      private Triple(L left, M middle, R right)
      Constructs a Triple of the three given objects.
      Parameters:
      left - The left item in the triple
      middle - The middle item in the triple
      right - The right item in the triple
  • Method Details

    • of

      public static <L, M, R> Triple<L,M,R> of(L left, M middle, R right)
      Constructs a Triple of the three given objects.
      Type Parameters:
      L - The type of the left item
      M - The type of the middle item
      R - The type of the right item
      Parameters:
      left - The left item in the Triple
      middle - The middle item in the Triple
      right - The right item in the Triple
      Returns:
      A Triple containing the three given items
    • getLeft

      public L getLeft()
      Returns:
      The left item from the Triple
    • setLeft

      public void setLeft(L left)
      Sets the left item of the Triple
      Parameters:
      left - The left item to set
    • getMiddle

      public M getMiddle()
      Returns:
      The middle item from the Triple
    • setMiddle

      public void setMiddle(M middle)
      Sets the middle item of the Triple
      Parameters:
      middle - The middle item to set
    • getRight

      public R getRight()
      Returns:
      The right item from the Triple
    • setRight

      public void setRight(R right)
      Sets the right item of the Triple
      Parameters:
      right - The right item to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      A string representation of the Triple as ({left item}, {middle item}, {right item})