Java Doc for CmdLnOption.java in  » Template-Engine » ostermillerutils » com » Ostermiller » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Template Engine » ostermillerutils » com.Ostermiller.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.Ostermiller.util.CmdLnOption

CmdLnOption
final public class CmdLnOption (Code)
A command line option used by the CommandLineOptions parser. More information about this class and code samples for suggested use are available from ostermiller.org.
author:
   Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
since:
   ostermillerutils 1.07.00



Constructor Summary
public  CmdLnOption(String[] longNames)
    
public  CmdLnOption(char[] shortNames)
    
public  CmdLnOption(String longName)
    
public  CmdLnOption(Character shortName)
    
public  CmdLnOption(String[] longNames, char[] shortNames)
    
public  CmdLnOption(String longName, Character shortName)
    

Method Summary
public  CmdLnOptionaddLongName(String name)
    
public  CmdLnOptionaddLongNames(Collection<String> longNames)
    
public  CmdLnOptionaddLongNames(String[] longNames)
    
public  CmdLnOptionaddShortName(Character name)
    
public  CmdLnOptionaddShortNames(Collection<Character> shortNames)
    
public  CmdLnOptionaddShortNames(char[] shortNames)
    
public  CmdLnOptionaddShortNames(Character[] shortNames)
    
public  StringgetDescription()
    
 StringgetHelp(String longStart, String shortStart, int indent, int lineWidth)
     Get the help message for this option appropriate for inclusion in "print help".

It will be formatted like this:

  --option -o   description
Two spaces at the beginning, and at least two spaces after the option specification before the description.
 intgetHelpArgumentsLength(String longStart, String shortStart)
     Get the length of the argument specification portion of the help message in characters.
 CmdLnListenergetListener()
    
 StringgetLongName()
    
 List<String>getLongNames()
    
 intgetMaxArguments()
    
 intgetMinArguments()
    
 CharactergetShortName()
    
 List<Character>getShortNames()
    
public  ObjectgetUserObject()
     An object that may be set by the user.
public  CmdLnOptionsetArgumentBounds(int minArguments, int maxArguments)
     Sets the bounds for command line arguments.
public  CmdLnOptionsetDescription(String description)
    
 voidsetImmutable()
     Called by the command line options parser to set this option to not modifiable.
public  CmdLnOptionsetListener(CmdLnListener callback)
    
public  CmdLnOptionsetNoArguments()
     Sets the argument bounds to require no arguments (zero arguments minimum, zero arguments maximum).
public  CmdLnOptionsetOptionalArgument()
     Sets the argument bounds for a single optional argument (zero arguments minimum, one argument maximum).
public  CmdLnOptionsetRequiredArgument()
     Sets the argument bounds for a single required argument (one argument minimum, one argument maximum).
public  CmdLnOptionsetUnlimitedArguments()
     Sets the argument bounds for unlimited (but optional) arguments (zero arguments minimum, Integer.MAX_VALUE arguments maximum).
public  CmdLnOptionsetUserObject(Object userObject)
     An object that may be set by the user.
public  StringtoString()
     Get a short string description this option.


Constructor Detail
CmdLnOption
public CmdLnOption(String[] longNames)(Code)

Parameters:
  longNames - list long names for this option
throws:
  IllegalArgumentException - if the the list does not contain at least one long name
since:
   ostermillerutils 1.07.00



CmdLnOption
public CmdLnOption(char[] shortNames)(Code)

Parameters:
  shortNames - list short names for this option
throws:
  IllegalArgumentException - if the the list does not contain at least one short name
since:
   ostermillerutils 1.07.00



CmdLnOption
public CmdLnOption(String longName)(Code)

Parameters:
  longName - the long name for this option
throws:
  IllegalArgumentException - if the name is null
since:
   ostermillerutils 1.07.00



CmdLnOption
public CmdLnOption(Character shortName)(Code)

Parameters:
  shortName - the short name for this option
since:
   ostermillerutils 1.07.00



CmdLnOption
public CmdLnOption(String[] longNames, char[] shortNames)(Code)

Parameters:
  longNames - list long names for this option
Parameters:
  shortNames - list short names for this option
throws:
  IllegalArgumentException - if the the lists do not contain at least one name
since:
   ostermillerutils 1.07.00



CmdLnOption
public CmdLnOption(String longName, Character shortName)(Code)

Parameters:
  longName - the long name for this option
Parameters:
  shortName - the short name for this option
since:
   ostermillerutils 1.07.00




Method Detail
addLongName
public CmdLnOption addLongName(String name)(Code)

Parameters:
  name - long name to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



addLongNames
public CmdLnOption addLongNames(Collection<String> longNames)(Code)

Parameters:
  longNames - long names to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



addLongNames
public CmdLnOption addLongNames(String[] longNames)(Code)

Parameters:
  longNames - long names to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



addShortName
public CmdLnOption addShortName(Character name)(Code)

Parameters:
  name - short name to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



addShortNames
public CmdLnOption addShortNames(Collection<Character> shortNames)(Code)

Parameters:
  shortNames - short names to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



addShortNames
public CmdLnOption addShortNames(char[] shortNames)(Code)

Parameters:
  shortNames - short names to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



addShortNames
public CmdLnOption addShortNames(Character[] shortNames)(Code)

Parameters:
  shortNames - short names to be added this for method chaining
throws:
  IllegalArgumentException - if the name is null or blank
since:
   ostermillerutils 1.07.00



getDescription
public String getDescription()(Code)
the description used in the help message or null ifno description has been set.
since:
   ostermillerutils 1.07.00



getHelp
String getHelp(String longStart, String shortStart, int indent, int lineWidth)(Code)
Get the help message for this option appropriate for inclusion in "print help".

It will be formatted like this:

  --option -o   description
Two spaces at the beginning, and at least two spaces after the option specification before the description. If the indent is large, there may be more spaces before the description.

If it is longer that the line width and must wrap, the description will continue on the next line which will start with eight spaces.
Parameters:
  longStart - What long options start with (typically "--")
Parameters:
  shortStart - What short options start with (typically "-")
Parameters:
  indent - Minimum character count at which to start the description after specifying the option
Parameters:
  lineWidth - Character count at which to wrap (if possible) help message
since:
   ostermillerutils 1.07.00




getHelpArgumentsLength
int getHelpArgumentsLength(String longStart, String shortStart)(Code)
Get the length of the argument specification portion of the help message in characters. Does not include any space between the specification and the description.
Parameters:
  longStart - What long options start with (typically "--")
Parameters:
  shortStart - What short options start with (typically "-") number of characters in the argument specification
since:
   ostermillerutils 1.07.00



getListener
CmdLnListener getListener()(Code)
Get the call back object the call back object
since:
   ostermillerutils 1.07.00



getLongName
String getLongName()(Code)
Get the first long name or null if no long names long name
since:
   ostermillerutils 1.07.00



getLongNames
List<String> getLongNames()(Code)
Get the entire list of long names unmodifiable list of long names



getMaxArguments
int getMaxArguments()(Code)
the maximum number of arguments allowed
since:
   ostermillerutils 1.07.00



getMinArguments
int getMinArguments()(Code)
the minimum number of arguments allowed
since:
   ostermillerutils 1.07.00



getShortName
Character getShortName()(Code)
Get the first short name or null if no short names short name
since:
   ostermillerutils 1.07.00



getShortNames
List<Character> getShortNames()(Code)
Get the entire list of short names unmodifiable list of short names
since:
   ostermillerutils 1.07.00



getUserObject
public Object getUserObject()(Code)
An object that may be set by the user. Suggested use: set the user object to an enum value that can be used in a switch statement.
since:
   ostermillerutils 1.07.00 the userObject



setArgumentBounds
public CmdLnOption setArgumentBounds(int minArguments, int maxArguments)(Code)
Sets the bounds for command line arguments.
Parameters:
  minArguments - the minimum number of arguments this command line option should expect
Parameters:
  maxArguments - the maximum number of arguments this command line option will accept
throws:
  IllegalArgumentException - if minimum arguments is negative
throws:
  IllegalArgumentException - if maximum arguments is less than minimum arguments
throws:
  IllegalStateException - if this argument has already been used in parsing CommandLineOptions this command line option for method chaining
since:
   ostermillerutils 1.07.00



setDescription
public CmdLnOption setDescription(String description)(Code)

Parameters:
  description - the description used in the help message this for method chaining
since:
   ostermillerutils 1.07.00



setImmutable
void setImmutable()(Code)
Called by the command line options parser to set this option to not modifiable.
since:
   ostermillerutils 1.07.00



setListener
public CmdLnOption setListener(CmdLnListener callback)(Code)
Set the call back object
Parameters:
  callback - the call back object this for method chaining
since:
   ostermillerutils 1.07.00



setNoArguments
public CmdLnOption setNoArguments()(Code)
Sets the argument bounds to require no arguments (zero arguments minimum, zero arguments maximum). This is the default state for a new command line option.
throws:
  IllegalStateException - if this argument has already been used in parsing CommandLineOptions this command line option for method chaining
since:
   ostermillerutils 1.07.00



setOptionalArgument
public CmdLnOption setOptionalArgument()(Code)
Sets the argument bounds for a single optional argument (zero arguments minimum, one argument maximum).
throws:
  IllegalStateException - if this argument has already been used in parsing CommandLineOptions this command line option for method chaining
since:
   ostermillerutils 1.07.00



setRequiredArgument
public CmdLnOption setRequiredArgument()(Code)
Sets the argument bounds for a single required argument (one argument minimum, one argument maximum).
throws:
  IllegalStateException - if this argument has already been used in parsing CommandLineOptions this command line option for method chaining
since:
   ostermillerutils 1.07.00



setUnlimitedArguments
public CmdLnOption setUnlimitedArguments()(Code)
Sets the argument bounds for unlimited (but optional) arguments (zero arguments minimum, Integer.MAX_VALUE arguments maximum).
throws:
  IllegalStateException - if this argument has already been used in parsing CommandLineOptions this command line option for method chaining



setUserObject
public CmdLnOption setUserObject(Object userObject)(Code)
An object that may be set by the user. Suggested use: set the user object to an enum value that can be used in a switch statement.
Parameters:
  userObject - the userObject to set this for method chaining
since:
   ostermillerutils 1.07.00



toString
public String toString()(Code)
Get a short string description this option. It will be either the long name (if it has one) or the short name if it does not have a long name string representation
since:
   ostermillerutils 1.07.00



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.