*/
public class OptionInfo{
+ /*
+ ex) 1000x800
+ ex) 1290x1024-256+128
+ */
private static final String REGEX_DIMNO =
"([1-9][0-9]{0,5})";
private static final String REGEX_SIGN =
* @throws IllegalArgumentException 引数の構文エラー
*/
private static void parseBooleanSwitch(OptionInfo info,
- CmdOption option,
- String optTxt,
- String onoff )
+ CmdOption option,
+ String optTxt,
+ String onoff )
throws IllegalArgumentException{
Boolean flag;
* @throws IllegalArgumentException 引数の構文エラー
*/
private static void parseGeometry(OptionInfo info,
- String optTxt,
- String geometry )
+ String optTxt,
+ String geometry )
throws IllegalArgumentException{
Matcher matcher = PATTERN_GEOMETRY.matcher(geometry);
if( ! matcher.matches() ){
* @throws IllegalArgumentException オプションの引数がない
*/
private static void parseOptionArg(OptionInfo info,
- String optTxt,
- CmdOption option,
- Iterator<String> iterator )
+ String optTxt,
+ CmdOption option,
+ Iterator<String> iterator )
throws IllegalArgumentException {
- String nextArg;
- if(iterator.hasNext()){
- nextArg = iterator.next();
- }else{
+ if( ! iterator.hasNext()){
String errMsg = MessageFormat.format(ERRFORM_NOARG, optTxt);
throw new IllegalArgumentException(errMsg);
}
+ String nextArg = iterator.next();
+
if(option == CmdOption.OPT_GEOMETRY){
parseGeometry(info, optTxt, nextArg);
}else if(option.isBooleanOption()){
* @return 指定されていたらtrue
*/
public boolean hasOption(CmdOption option){
- if(this.optionList.contains(option)) return true;
- return false;
+ boolean result = this.optionList.contains(option);
+ return result;
}
/**