Package org.scijava.console
Class AbstractConsoleArgument
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.plugin.AbstractTypedPlugin<D>
-
- org.scijava.plugin.AbstractHandlerPlugin<LinkedList<String>>
-
- org.scijava.console.AbstractConsoleArgument
-
- All Implemented Interfaces:
Comparable<Prioritized>,ConsoleArgument,Contextual,Identifiable,Locatable,Logged,HandlerPlugin<LinkedList<String>>,HasPluginInfo,RichPlugin,SciJavaPlugin,SingletonPlugin,TypedPlugin<LinkedList<String>>,Prioritized,Typed<LinkedList<String>>,Versioned
- Direct Known Subclasses:
HeadlessArgument,MainArgument,OpenArgument,RunArgument,RunArgument,RunScriptArgument,ShowUIArgument,SystemPropertyArgument,UIArgument
public abstract class AbstractConsoleArgument extends AbstractHandlerPlugin<LinkedList<String>> implements ConsoleArgument
Abstract superclass ofConsoleArgumentimplementations.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description AbstractConsoleArgument()AbstractConsoleArgument(int requiredArgs, String... flags)AbstractConsoleArgument(String... flags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetParam(LinkedList<String> args)If the next argument is an appropriate parameter to aConsoleArgument, retrieves it; otherwise, returns null.protected booleanisFlag(LinkedList<String> args)Check if the given list of arguments starts with a flag that matches thisConsoleArgument.booleansupports(LinkedList<String> args)Gets whether this object is compatible with the given data object.-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.console.ConsoleArgument
getType, handle
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
supports
public boolean supports(LinkedList<String> args)
Description copied from interface:TypedGets whether this object is compatible with the given data object.By default, this method will return
trueiff the data is assignable to the associated type given byTyped.getType(). But individual implementations may have other requirements beyond class assignability.- Specified by:
supportsin interfaceTyped<LinkedList<String>>- Overrides:
supportsin classAbstractTypedPlugin<LinkedList<String>>
-
isFlag
protected boolean isFlag(LinkedList<String> args)
Check if the given list of arguments starts with a flag that matches thisConsoleArgument.- Returns:
- true iff one of this argument's flags matches the first string in the given list, or this argument has no explicit flags.
-
getParam
protected String getParam(LinkedList<String> args)
If the next argument is an appropriate parameter to aConsoleArgument, retrieves it; otherwise, returns null.- Returns:
- The first argument of the given list, if it does not
start with a
'-'character; or null otherwise.
-
-