home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
StringArrayOption.java
< prev
next >
Wrap
Text File
|
1998-09-08
|
2KB
|
87 lines
package com.symantec.itools.frameworks.application.commandline;
/**
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public abstract class StringArrayOption
extends ArrayOption
{
public StringArrayOption()
{
}
public StringArrayOption(String[] flags)
{
super(flags);
}
public StringArrayOption(String[] flags, int count)
{
super(flags, count);
}
/**
* @param args TODO
* @param startIndex TODO
* @since VCafe 3.0
*/
/*
args[ start_index ] will be the flag.
args[ start_index + 1 ] should be the first integer value
*/
protected String[] getStringArray(String[] args, int startIndex)
{
String[] array;
array = new String[count];
for(int i = 0; i < count; i++)
{
array[i] = args[startIndex + i + 1];
}
return (array);
}
/**
* @param args TODO
* @param startIndex TODO
* @param count TODO
* @exception com.symantec.itools.frameworks.application.commandline.MissingArgumentsException
* @since VCafe 3.0
*/
/*
args[ start_index ] will be the flag.
args[ start_index + 1 ] should be the first integer value
*/
protected String[] getStringArray(String[] args, int startIndex, int count)
throws MissingArgumentsException
{
String[] array;
this.count = count;
array = new String[count];
try
{
for(int i = 0; i < count; i++)
{
array[i] = args[startIndex + i + 1];
}
}
catch(ArrayIndexOutOfBoundsException ex)
{
throw new MissingArgumentsException(args[startIndex]);
}
return (array);
}
}