coins.driver
クラス Warning

java.lang.Object
  |
  +--coins.driver.Warning

public class Warning
extends java.lang.Object

Warning controller.
A warning controller is initialized by warning options specified in a command line and determine which warning message should be printed.
There are two types of warning messages: generic (category-free) warning messages and categorized warining messages.
A `warning number' is an identifier of a warning message. It can be given to both types of a warning message, and if given, it is printed with the message. Assignment of a warning number is out of scope of this class.
A warning option should be given in the forms:

-Wcategory
-Wno-category
or,
-Wall
The form -Wcategory is to print warning messages of category category, and the form -Wno-category is not to print. When both -Wcategory and -Wno-category are specified for a same category, the latter one overwrites the formar one. -Wall is to print all warning messages, except ones which is specified not to print. A generic warning message should be printed only if the -Wall is specified.
A warning controller has a table which maps a warning category to a Boolean object: true for to print it and false for not to print it.


コンストラクタの概要
Warning()
          Constructs a default warning controller which has no warning.
Warning(IoRoot pIo)
          Constructs a default warning controller which has no warning specification and prints warning messages to a specified IoRoot.
Warning(java.util.List warningArguments)
          Constructs a warning controller which is initialized by warning options.
Warning(java.util.List warningArguments, IoRoot pIo)
          Constructs a warning controller which is initialized by warning options and prints warning messages to a specified IoRoot.
 
メソッドの概要
 boolean getGenericWarningFlag()
          Return whether the -Wall is specified or not.
 java.lang.Boolean getWarningFlag(java.lang.String category)
          Returns a corresponding Boolean value in the table associated with a warning category, or null if the category does not exist in the table.
 boolean setGenericWarningFlag(boolean newValue)
          Redefines whether the -Wall is specified or not.
 void setIoRoot(IoRoot pIo)
           
 java.lang.Boolean setWarningFlag(java.lang.String category, boolean newFlag)
          Redefines a corresponding Boolean value in the table associated with a warning category.
 boolean shouldWarn()
          Tests if generic warning messages should be printed or not.
 boolean shouldWarn(java.lang.String category)
          Tests if warning messages of a specified category should be printed or not.
 void warning(int warningNumber, java.lang.String message)
          Prints a generic warning message with a warning number when it should be printed.
 void warning(int warningNumber, java.lang.String category, java.lang.String message)
          Prints a warning message of a certain warning category with a warning number when it should be printed.
 void warning(java.lang.String message)
          Prints a generic warning message when it should be printed.
 void warning(java.lang.String category, java.lang.String message)
          Prints a warning message of a certain warning category when it should be printed.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Warning

public Warning()
Constructs a default warning controller which has no warning.


Warning

public Warning(IoRoot pIo)
Constructs a default warning controller which has no warning specification and prints warning messages to a specified IoRoot.


Warning

public Warning(java.util.List warningArguments)
Constructs a warning controller which is initialized by warning options. The options are given by a List of Strings, each of String is a command line option string excluding the leading "-W".

パラメータ:
warningArguments - the option strings

Warning

public Warning(java.util.List warningArguments,
               IoRoot pIo)
Constructs a warning controller which is initialized by warning options and prints warning messages to a specified IoRoot. The options are given by a List of Strings, each of String is a command line option string excluding the leading "-W".

パラメータ:
warningArguments - the option strings
pIo - the IoRoot
メソッドの詳細

getGenericWarningFlag

public boolean getGenericWarningFlag()
Return whether the -Wall is specified or not.

戻り値:
true if specified, false otherwise.

setGenericWarningFlag

public boolean setGenericWarningFlag(boolean newValue)
Redefines whether the -Wall is specified or not. Specify true to set, false otherwise.

パラメータ:
newValue - the new value
戻り値:
the old value

getWarningFlag

public java.lang.Boolean getWarningFlag(java.lang.String category)
Returns a corresponding Boolean value in the table associated with a warning category, or null if the category does not exist in the table.

パラメータ:
category - the category

setWarningFlag

public java.lang.Boolean setWarningFlag(java.lang.String category,
                                        boolean newFlag)
Redefines a corresponding Boolean value in the table associated with a warning category. Returns the old value, or null if the category did not exist in the table.

パラメータ:
category - the category
newFlag - the new value
戻り値:
the old value.

shouldWarn

public boolean shouldWarn()
Tests if generic warning messages should be printed or not.

戻り値:
true if it should be printed, false otherwise.

shouldWarn

public boolean shouldWarn(java.lang.String category)
Tests if warning messages of a specified category should be printed or not.

パラメータ:
category - the category
戻り値:
true if it should be printed, false otherwise.

setIoRoot

public void setIoRoot(IoRoot pIo)

warning

public void warning(java.lang.String message)
Prints a generic warning message when it should be printed.

パラメータ:
message - the warning message

warning

public void warning(int warningNumber,
                    java.lang.String message)
Prints a generic warning message with a warning number when it should be printed.

パラメータ:
warningNumber - the warning number
message - the warning message

warning

public void warning(java.lang.String category,
                    java.lang.String message)
Prints a warning message of a certain warning category when it should be printed.

パラメータ:
category - the warning category
message - the warning message

warning

public void warning(int warningNumber,
                    java.lang.String category,
                    java.lang.String message)
Prints a warning message of a certain warning category with a warning number when it should be printed.

パラメータ:
warningNumber - the warning number
category - the warning category
message - the warning message