Created
May 2, 2014 05:24
-
-
Save dha-lo-jd/ad5a0f933d72ea404d2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArgsPicker { | |
private int i = 0; | |
private final String[] args; | |
public ArgsPicker(String[] args) { | |
this.args = args; | |
} | |
public String nextArg(String defaultValue) { | |
String result = defaultValue; | |
if (args != null) { | |
if (args.length > i) { | |
result = args[i++]; | |
} | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment