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

jscl.text.Factor Maven / Gradle / Ivy

There is a newer version: 1.0.11
Show newest version
package jscl.text;

import jscl.math.Generic;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * User: serso
 * Date: 10/27/11
 * Time: 2:45 PM
 */
class Factor implements Parser {

	public static final Parser parser = new Factor();

	private Factor() {
	}

	public Generic parse(@Nonnull Parameters p, @Nullable Generic previousSumElement) throws ParseException {

		boolean sign = MinusParser.parser.parse(p, previousSumElement).isSign();

		final Generic result = (Generic) UnsignedFactor.parser.parse(p, previousSumElement);

		return sign ? result.negate() : result;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy