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

it.ssc.parser.ParserValueBoolean Maven / Gradle / Ivy

Go to download

This is a JSR331 interface for SSC (Software for the Calculation of the Simplex) is a java library for solving linear programming problems v. 3.0.1. SSC was designed and developed by Stefano Scarioli.

The newest version!
package it.ssc.parser;

import it.ssc.parser.exception.InvalidBooleanFormatException;

public class ParserValueBoolean {
	
	public static boolean parser(String value) throws InvalidBooleanFormatException   {
		if(value.equalsIgnoreCase("true")) return true;
		else if(value.equalsIgnoreCase("t")) return true;
		else if(value.equalsIgnoreCase("false")) return false;
		else if(value.equalsIgnoreCase("f")) return false;
		else { 
			throw new InvalidBooleanFormatException("ERRORE ! Il valore "+value +" letto non e' un booleano (valori acettati 'F', 'FALSE', 'T' , 'TRUE')");
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy