00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.skin.io;
00023
00024 import java.io.IOException;
00025 import org.jetbrains.annotations.NotNull;
00026
00031 public class Args {
00032
00036 @NotNull
00037 private final String[] args;
00038
00042 private int index = 0;
00043
00048 public Args(@NotNull final String[] args) {
00049 this.args = args;
00050 }
00051
00057 @NotNull
00058 public String get() throws IOException {
00059 try {
00060 return args[index++];
00061 } catch (final ArrayIndexOutOfBoundsException ignored) {
00062 throw new IOException("missing argument");
00063 }
00064 }
00065
00071 @NotNull
00072 public String getPrev() {
00073 return args[index-1];
00074 }
00075
00080 public boolean hasMore() {
00081 return index < args.length;
00082 }
00083
00084 }