001package jmri.jmrit.logixng.util.parser; 002 003/** 004 * Definition of a constant used in expressions. 005 * 006 * @author Daniel Bergqvist 2021 007 */ 008public final class Constant { 009 010 private final String _module; 011 private final String _name; 012 private final Object _value; 013 014 015 public Constant(String m, String name, Object value) { 016 this._module = m; 017 this._name = name; 018 this._value = value; 019 } 020 021 /** 022 * Get the module of the constant, for example "Math" or "Conversion". 023 * @return the module name 024 */ 025 public String getModule() { 026 return _module; 027 } 028 029 /** 030 * Get name of the function, for example "MathPI" or "MathE" 031 * @return the name 032 */ 033 public String getName() { 034 return _name; 035 } 036 037 /** 038 * Return the value of the constant. 039 * @return the result 040 */ 041 public Object getValue() { 042 return _value; 043 } 044 045}