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

com.g2forge.alexandria.expression.numeric.NumericVariable Maven / Gradle / Ivy

Go to download

A library for expressions and their evaluation. Includes a basic implementation for math.

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.expression.numeric;

import com.g2forge.alexandria.expression.IVariable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class NumericVariable implements IVariable, INumericExpression {
	protected String name;

	@Override
	public INumericExpression apply(NumericEnvironment environment) {
		return (environment == null) ? this : environment.lookup(this).or(this);
	}

	@Override
	public INumericExpression reduce() {
		return this;
	}

	@Override
	public String toString() {
		return getName();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy