home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
IntArrayOption.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 IntArrayOption
extends ArrayOption
{
public IntArrayOption()
{
}
public IntArrayOption(String[] flags)
{
super(flags);
}
public IntArrayOption(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 int[] getIntArray(String[] args, int startIndex)
throws MissingArgumentsException
{
int[] array;
array = new int[count];
try
{
for(int i = 0; i < count; i++)
{
array[i] = Integer.parseInt(args[startIndex + i + 1]);
}
}
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 int[] getIntArray(String[] args, int startIndex, int count)
throws MissingArgumentsException
{
int[] array;
this.count = count;
array = new int[count];
try
{
for(int i = 0; i < count; i++)
{
array[i] = Integer.parseInt(args[startIndex + i + 1]);
}
}
catch(ArrayIndexOutOfBoundsException ex)
{
throw new MissingArgumentsException(args[startIndex]);
}
return (array);
}
}