/* Autor: Dieter Schultschik * MatNr: 0125258 * email: e0125258@student.tuwien.ac.at */ package Wider; public class WiderstandsNetz { private float fValue = 0; public WiderstandsNetz(String sInit, boolean bDebug) throws ParseErrorException { FLAGS.DEBUG = bDebug; try{ checkInput(sInit); fValue = WidParser.parse(sInit); } catch(ParseErrorException e) { throw e; } } public float getValue() { return fValue; } private void checkInput(String sInit) throws ParseErrorException { String sAllowed = "0123456789()+/"; for(int i=0; i < sInit.length(); i++) if(sAllowed.indexOf(sInit.charAt(i)) == -1) throw new ParseErrorException("Invalid Character in String"); } }