@Test public void reset() throws ParseException { String[] argv = new String[]{"-a", "foo", "-bc", "argument1" }; Getopt instance = new Getopt(argv, "a:bc"); instance.parse(); assertEquals('a', (char) instance.getOpt()); assertEquals("foo", instance.getOptarg()); assertEquals('b', (char) instance.getOpt()); assertNull(instance.getOptarg()); assertEquals('c', (char) instance.getOpt()); assertNull(instance.getOptarg()); assertEquals(-1, instance.getOpt()); assertEquals(3, instance.getOptind()); assertTrue(instance.getOptind() < argv.length); assertEquals("argument1", argv[instance.getOptind()]); instance.reset(); assertEquals('a', (char) instance.getOpt()); assertEquals("foo", instance.getOptarg()); assertEquals('b', (char) instance.getOpt()); assertNull(instance.getOptarg()); assertEquals('c', (char) instance.getOpt()); assertNull(instance.getOptarg()); assertEquals(-1, instance.getOpt()); assertEquals(3, instance.getOptind()); assertTrue(instance.getOptind() < argv.length); assertEquals("argument1", argv[instance.getOptind()]); }
public void reset() { current = -1; }
Getopt { public void reset() { current = -1; } }
Getopt { public void reset() { current = -1; } Getopt(String[] argv, String opts); }
Getopt { public void reset() { current = -1; } Getopt(String[] argv, String opts); void parse(); int getOpt(); void reset(); String getOptarg(); int getOptind(); }
Getopt { public void reset() { current = -1; } Getopt(String[] argv, String opts); void parse(); int getOpt(); void reset(); String getOptarg(); int getOptind();  }