/** * Parses a given list of options. * <!-- options-start --> * Valid options are: <p/> * * <pre> -C <classname and options> * The construction method to employ. Either TopDown or BottomUp * (default: weka.core.TopDownConstructor)</pre> * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { super.setOptions(options); String optionString = Utils.getOption('C', options); if(optionString.length() != 0) { String constructorSpec[] = Utils.splitOptions(optionString); if(constructorSpec.length == 0) { throw new Exception("Invalid BallTreeConstructor specification string."); } String className = constructorSpec[0]; constructorSpec[0] = ""; setBallTreeConstructor( (BallTreeConstructor) Utils.forName( BallTreeConstructor.class, className, constructorSpec) ); } else { setBallTreeConstructor(new TopDownConstructor()); } Utils.checkForRemainingOptions(options); }
/** * Parses a given list of options. * <!-- options-start --> * Valid options are: <p/> * * <pre> -C <classname and options> * The construction method to employ. Either TopDown or BottomUp * (default: weka.core.TopDownConstructor)</pre> * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { super.setOptions(options); String optionString = Utils.getOption('C', options); if(optionString.length() != 0) { String constructorSpec[] = Utils.splitOptions(optionString); if(constructorSpec.length == 0) { throw new Exception("Invalid BallTreeConstructor specification string."); } String className = constructorSpec[0]; constructorSpec[0] = ""; setBallTreeConstructor( (BallTreeConstructor) Utils.forName( BallTreeConstructor.class, className, constructorSpec) ); } else { setBallTreeConstructor(new TopDownConstructor()); } }
/** * Returns the BallTreeConstructor currently in use. * @return The BallTreeConstructor currently in use. */ public BallTreeConstructor getBallTreeConstructor() { return m_TreeConstructor; }
/** * Sets the BallTreeConstructor for building the BallTree * (default TopDownConstructor). * @param constructor The new BallTreeConstructor. */ public void setBallTreeConstructor(BallTreeConstructor constructor) { m_TreeConstructor = constructor; }