Methods Summary |
---|
public final void | addArgument(java.lang.String argument)Mutator of Argument property.
if( null == m_arguments ) m_arguments = new String[] { argument };
else
{
final String[] arguments = new String[ m_arguments.length + 1 ];
System.arraycopy( m_arguments, 0, arguments, 0, m_arguments.length );
arguments[ m_arguments.length ] = argument;
m_arguments = arguments;
}
|
public final java.lang.String | getArgument()Retrieve argument to option if it takes arguments.
return getArgument( 0 );
|
public final java.lang.String | getArgument(int index)Retrieve indexed argument to option if it takes arguments.
if( null == m_arguments || index < 0 || index >= m_arguments.length )
{
return null;
}
else
{
return m_arguments[ index ];
}
|
public final int | getArgumentCount()Get number of arguments.
if( null == m_arguments )
{
return 0;
}
else
{
return m_arguments.length;
}
|
public final int | getId()Retrieve id of option.
The id is eqivalent to character code if it can be a single letter option.
return m_id;
|
public final java.lang.String | toString()Convert to String.
final StringBuffer sb = new StringBuffer();
sb.append( "[Option " );
sb.append( (char)m_id );
if( null != m_arguments )
{
sb.append( ", " );
sb.append( Arrays.asList( m_arguments ) );
}
sb.append( " ]" );
return sb.toString();
|