All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.czyzby.kiwi.util.tuple.TripleTuple Maven / Gradle / Ivy

There is a newer version: 1.9.1.9.6
Show newest version
package com.github.czyzby.kiwi.util.tuple;

import java.util.Map;

/** Interface shared by both mutable and immutable triple tuples. Ensures that tuples contain methods that allow to
 * obtain stored values.
 *
 * @author MJ */
public interface TripleTuple extends Iterable, Map.Entry, Tuple {
    int SIZE = 3;

    /** @return first value stored in triple. Equivalent of getKey. */
    public First getFirst();

    /** @return true if first value in triple is not null. */
    public boolean isFirstPresent();

    /** @return second value stored in triple. Equivalent of getValue. */
    public Second getSecond();

    /** @return true if second value in triple is not null. */
    public boolean isSecondPresent();

    /** @return third value stored in triple. */
    public Third getThird();

    /** @return true if third value in triple is not null. */
    public boolean isThirdPresent();

    /** @return a new triple with inverted variables order. */
    public TripleTuple invert();

    /** @return a new triple with values shifted left. */
    public TripleTuple shiftLeft();

    /** @return a new triple with values shifted right. */
    public TripleTuple shitfRight();
}