scg/ch10/NamedArgumentsFANG

From FANG

Jump to: navigation, search

01 package scg.ch10;
02 
03 import java.util.ArrayList;
04 
05 import fang2.core.Game;
06 import fang2.util.InitializeApplication;
07 
08 /**
09  * Uses FANG methods to get the arguments passed into the program.
10  */
11 public class NamedArgumentsFANG
12   extends Game {
13   /**
14    List all the command-line arguments on standard output.
15    */
16   @Override
17   public void setup() {
18     System.out.println("NamedArgumentsFANG:");
19     ArrayList<String> names = InitializeApplication.getArgumentNames();
20     for (int = 0; i != names.size()++i{
21       ArrayList<String> args = InitializeApplication.getNamedArgs(
22           names.get(i));
23       for (int argumentNdx = 0; argumentNdx != args.size();
24           ++argumentNdx{
25         System.out.println("  args[\"" + names.get(i+ "\"][" +
26           argumentNdx + "] = \"" + args.get(argumentNdx+ "\"");
27       }
28     }
29   }
30 }
31 
32 //Uploaded on Mon Mar 29 21:38:57 EDT 2010


Download/View scg/ch10/NamedArgumentsFANG.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter

Games
Games