javolution.util.function.MultiVariable Maven / Gradle / Ivy
/*
* Javolution - Java(TM) Solution for Real-Time and Embedded Systems
* Copyright (C) 2012 - Javolution (http://javolution.org/)
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software is
* freely granted, provided that this notice is preserved.
*/
package javolution.util.function;
/**
* An object holding multiple variables; typically used to create
* {@link Function multi-parameters functions}.
*
* Multi-variables may represent an unbounded number of variables.
* [code]
* MultiVariable> tertiaryVariable
* = new MultiVariable(2.3, new MultiVariable(57, true));
* [/code].
*
* @param the type of the variable on the left.
* @param the type of the variable on the right.
*
* @author Jean-Marie Dautelle
* @version 6.0, July 21, 2013
*/
public class MultiVariable {
private final L left;
private final R right;
/**
* Returns a multi-variable holding the specified objects (possibly
* multi-variables themselves).
*/
public MultiVariable(L left, R right) {
this.left = left;
this.right = right;
}
/**
* Returns the variable on the left.
*/
public L getLeft() {
return left;
}
/**
* Returns the variable on the right.
*/
public R getRight() {
return right;
}
}