com.adamcornett.cminus
Class Compiler.flag

java.lang.Object
  extended by com.adamcornett.cminus.Compiler.flag
All Implemented Interfaces:
Comparable<Compiler.flag>
Enclosing class:
Compiler

private static class Compiler.flag
extends Object
implements Comparable<Compiler.flag>

Represents a command line argument or flag

Author:
Adam Cornett

Field Summary
(package private)  String description
          The description of the flag, used when printing the help/usage message
(package private)  boolean isRequired
          True if the flag must be set on the command line
(package private) static HashMap<String,Compiler.flag> longFlags
          A collection of all flags mapped to the long string
(package private)  String longName
          This is a long version (full word) version of a flag.
(package private) static HashMap<Character,Compiler.flag> shortFlags
          A collection of all flags mapped to the short string
(package private)  Character shortName
          This is the short (single character) version of a flag.
(package private)  boolean takesValue
          True if the flag requires a value.
(package private)  String value
          The value given on the command line
 
Constructor Summary
Compiler.flag(Character s, String l, String d, boolean v, boolean r)
           
 
Method Summary
 int compareTo(Compiler.flag o)
           
 boolean equals(Object obj)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longFlags

static HashMap<String,Compiler.flag> longFlags
A collection of all flags mapped to the long string


shortFlags

static HashMap<Character,Compiler.flag> shortFlags
A collection of all flags mapped to the short string


description

String description
The description of the flag, used when printing the help/usage message


isRequired

boolean isRequired
True if the flag must be set on the command line


longName

String longName
This is a long version (full word) version of a flag.


shortName

Character shortName
This is the short (single character) version of a flag.


takesValue

boolean takesValue
True if the flag requires a value.


value

String value
The value given on the command line

Constructor Detail

Compiler.flag

public Compiler.flag(Character s,
                     String l,
                     String d,
                     boolean v,
                     boolean r)
Parameters:
s - Short arg (single character)
l - Long Arg
d - Description
v - Takes Value
r - Required
Method Detail

compareTo

public int compareTo(Compiler.flag o)
Specified by:
compareTo in interface Comparable<Compiler.flag>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object