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

weka.core.Option Maven / Gradle / Ivy

Go to download

The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This version represents the developer version, the "bleeding edge" of development, you could say. New functionality gets added to this version.

There is a newer version: 3.9.6
Show newest version
/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see .
 */

/*
 *    Option.java
 *    Copyright (C) 1999-2012 University of Waikato, Hamilton, New Zealand
 *
 */

package weka.core;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.File;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;

/**
 * Class to store information about an option.
 * 

* * Typical usage: *

* * Option myOption = new Option("Uses extended mode.", "E", 0, "-E")); *

* * @author Eibe Frank ([email protected]) * @version $Revision: 15700 $ */ public class Option implements RevisionHandler { /** A cache of property descriptors */ private static final Map, PropertyDescriptor[]> s_descriptorCache = new HashMap, PropertyDescriptor[]>(); /** What does this option do? */ private String m_Description; /** The synopsis. */ private String m_Synopsis; /** What's the option's name? */ private String m_Name; /** How many arguments does it take? */ private int m_NumArguments; /** * Creates new option with the given parameters. * * @param description the option's description * @param name the option's name * @param numArguments the number of arguments * @param synopsis the option's synopsis */ public Option(String description, String name, int numArguments, String synopsis) { m_Description = description; m_Name = name; m_NumArguments = numArguments; m_Synopsis = synopsis; } /** * Get a list of options for a class. Options identified by this method are * bean properties (with get/set methods) annotated using the OptionMetadata * annotation. All options from the class up to, but not including, the * supplied oldest superclass are returned. * * * @param childClazz the class to get options for * @param oldestAncestorClazz the oldest superclass (inclusive) at which to * stop getting options from * @return a list of options */ public static Vector





© 2015 - 2024 Weber Informatics LLC | Privacy Policy