/** * Adds user defined elements (such as: Arguments, Constants, Functions) * to the expressions. * * @param elements Elements list (variadic), where Argument, Constant, Function * extend the same class PrimitiveElement * * @see PrimitiveElement */ public void addDefinitions(PrimitiveElement... elements) { for (PrimitiveElement e : elements) { int elementTypeId = e.getMyTypeId(); if (e != null) { if (elementTypeId == Argument.TYPE_ID) addArguments((Argument)e); else if (elementTypeId == Constant.TYPE_ID) addConstants((Constant)e); else if (elementTypeId == Function.TYPE_ID) addFunctions((Function)e); else if (elementTypeId == RecursiveArgument.TYPE_ID_RECURSIVE) addArguments((Argument)e); } } } /**
/** * Removes user defined elements (such as: Arguments, Constants, Functions) * to the expressions. * * @param elements Elements list (variadic), where Argument, Constant, Function * extend the same class PrimitiveElement * * @see PrimitiveElement */ public void removeDefinitions(PrimitiveElement... elements) { for (PrimitiveElement e : elements) { int elementTypeId = e.getMyTypeId(); if (e != null) { if (elementTypeId == Argument.TYPE_ID) removeArguments((Argument)e); else if (elementTypeId == Constant.TYPE_ID) removeConstants((Constant)e); else if (elementTypeId == Function.TYPE_ID) removeFunctions((Function)e); else if (elementTypeId == RecursiveArgument.TYPE_ID_RECURSIVE) removeArguments((Argument)e); } } } /*=================================================