home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
DoubleArrayOption.java
< prev
next >
Wrap
Text File
|
1998-09-08
|
2KB
|
96 lines
package com.symantec.itools.frameworks.application.commandline;
/**
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public abstract class DoubleArrayOption
extends ArrayOption
{
public DoubleArrayOption()
{
}
public DoubleArrayOption(String[] flags)
{
super(flags);
}
public DoubleArrayOption(String[] flags, int count)
{
super(flags, count);
}
/**
* @param args TODO
* @param startIndex 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 double[] getDoubleArray(String[] args, int startIndex)
throws MissingArgumentsException
{
double[] array;
array = new double[count];
try
{
for(int i = 0; i < count; i++)
{
array[i] = Double.valueOf(args[startIndex + i + 1]).doubleValue();
}
}
catch(ArrayIndexOutOfBoundsException ex)
{
throw new MissingArgumentsException(args[startIndex]);
}
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);
}
}