public void initConstants()
    {
        if (NUMBERS != null)
            return;

        if (((BaseField)this.getField()).getRecord().getRecordOwner() != null)
        {
            org.jbundle.model.Task task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask();
            ResourceBundle resources = ((BaseApplication)task.getApplication()).getResources(ResourceConstants.AMOUNT_RESOURCE, true);
            NUMBERS = new String[10];
            for (int i = 0; i < 10; i++)
            {
                NUMBERS[i] = resources.getString(Integer.toString(i));
            }

            TEENS = new String[10];
            for (int i = 10; i < 20; i++)
            {
                TEENS[i - 10] = resources.getString(Integer.toString(i));
            }

            TENS = new String[10];
            for (int i = 2; i < 10; i++)
            {
                TENS[i] = resources.getString(Integer.toString(i * 10));
            }

            HUNDRED = resources.getString("100");
            THOUSAND = resources.getString("1000");
            MILLION = resources.getString("1000000");
            BILLION = resources.getString("1000000000");
            AND = resources.getString("&");
        }
        else
        {
            NUMBERS[0] = "Zero";NUMBERS[1] = "One";NUMBERS[2] = "Two";NUMBERS[3] = "Three";NUMBERS[4] = "Four";
            NUMBERS[5] = "Five";NUMBERS[6] = "Six";NUMBERS[7] = "Seven";NUMBERS[8] = "Eight";NUMBERS[9] = "Nine";
            TEENS[0] = "ten";TEENS[1] = "Eleven";TEENS[2] = "Twelve";TEENS[3] = "Thirteen";TEENS[4] = "Fourteen";
            TEENS[5] = "Fifteen";TEENS[6] = "Sixteen";TEENS[7] = "Seventeen";TEENS[8] = "Eighteen";TEENS[9] = "Nineteen";
            TENS[0] = Constants.BLANK;TENS[1] = Constants.BLANK;TENS[2] = "Twenty";TENS[3] = "Thirty";TENS[4] = "Forty";
            TENS[5] = "Fifty";TENS[6] = "Sixty";TENS[7] = "Seventy";TENS[8] = "Eighty";TENS[9] = "Ninety";
            HUNDRED = "Hundred";
            THOUSAND = "Thousand";
            MILLION = "Million";
            BILLION = "Billion";
            AND = "and";
        }
    }
public void initConstants ( ) { if ( NUMBERS != null ) return ; if ( ( ( BaseField ) this . getField ( ) ) . getRecord ( ) . getRecordOwner ( ) != null ) { org . jbundle . model . Task task = ( ( BaseField ) this . getField ( ) ) . getRecord ( ) . getRecordOwner ( ) . getTask ( ) ; ResourceBundle resources = ( ( BaseApplication ) task . getApplication ( ) ) . getResources ( ResourceConstants . AMOUNT_RESOURCE , true ) ; NUMBERS = new String [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { NUMBERS [ i ] = resources . getString ( Integer . toString ( i ) ) ; } TEENS = new String [ 10 ] ; for ( int i = 10 ; i < 20 ; i ++ ) { TEENS [ i - 10 ] = resources . getString ( Integer . toString ( i ) ) ; } TENS = new String [ 10 ] ; for ( int i = 2 ; i < 10 ; i ++ ) { TENS [ i ] = resources . getString ( Integer . toString ( i * 10 ) ) ; } HUNDRED = resources . getString ( "100" ) ; THOUSAND = resources . getString ( "1000" ) ; MILLION = resources . getString ( "1000000" ) ; BILLION = resources . getString ( "1000000000" ) ; AND = resources . getString ( "&" ) ; } else { NUMBERS [ 0 ] = "Zero" ; NUMBERS [ 1 ] = "One" ; NUMBERS [ 2 ] = "Two" ; NUMBERS [ 3 ] = "Three" ; NUMBERS [ 4 ] = "Four" ; NUMBERS [ 5 ] = "Five" ; NUMBERS [ 6 ] = "Six" ; NUMBERS [ 7 ] = "Seven" ; NUMBERS [ 8 ] = "Eight" ; NUMBERS [ 9 ] = "Nine" ; TEENS [ 0 ] = "ten" ; TEENS [ 1 ] = "Eleven" ; TEENS [ 2 ] = "Twelve" ; TEENS [ 3 ] = "Thirteen" ; TEENS [ 4 ] = "Fourteen" ; TEENS [ 5 ] = "Fifteen" ; TEENS [ 6 ] = "Sixteen" ; TEENS [ 7 ] = "Seventeen" ; TEENS [ 8 ] = "Eighteen" ; TEENS [ 9 ] = "Nineteen" ; TENS [ 0 ] = Constants . BLANK ; TENS [ 1 ] = Constants . BLANK ; TENS [ 2 ] = "Twenty" ; TENS [ 3 ] = "Thirty" ; TENS [ 4 ] = "Forty" ; TENS [ 5 ] = "Fifty" ; TENS [ 6 ] = "Sixty" ; TENS [ 7 ] = "Seventy" ; TENS [ 8 ] = "Eighty" ; TENS [ 9 ] = "Ninety" ; HUNDRED = "Hundred" ; THOUSAND = "Thousand" ; MILLION = "Million" ; BILLION = "Billion" ; AND = "and" ; } }
Init the number constants.