public abstract class AbstractConsoleArgument extends AbstractHandlerPlugin<LinkedList<String>> implements ConsoleArgument
ConsoleArgument
implementations.Constructor and Description |
---|
AbstractConsoleArgument() |
AbstractConsoleArgument(int requiredArgs,
String... flags) |
AbstractConsoleArgument(String... flags) |
Modifier and Type | Method and Description |
---|---|
protected String |
getParam(LinkedList<String> args)
If the next argument is an appropriate parameter to a
ConsoleArgument , retrieves it; otherwise, returns null. |
Class<LinkedList<String>> |
getType()
Gets the type associated with the object.
|
protected boolean |
isFlag(LinkedList<String> args)
Check if the given list of arguments starts with a flag that matches this
ConsoleArgument . |
boolean |
supports(LinkedList<String> args)
Gets whether this object is compatible with the given data object.
|
compareTo, getInfo, getPriority, setInfo, setPriority, toString
context, getContext, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
handle
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
public AbstractConsoleArgument()
public AbstractConsoleArgument(String... flags)
public AbstractConsoleArgument(int requiredArgs, String... flags)
public boolean supports(LinkedList<String> args)
Typed
By default, this method will return true
always, since the type is
known to be compatible. But individual implementations may have other
requirements beyond class assignability.
supports
in interface Typed<LinkedList<String>>
supports
in class AbstractTypedPlugin<LinkedList<String>>
public Class<LinkedList<String>> getType()
Typed
getType
in interface Typed<LinkedList<String>>
protected boolean isFlag(LinkedList<String> args)
ConsoleArgument
.protected String getParam(LinkedList<String> args)
ConsoleArgument
, retrieves it; otherwise, returns null.'-'
character; or null otherwise.Copyright © 2009–2016 SciJava. All rights reserved.