Changeset 2284


Ignore:
Timestamp:
Jan 24, 2007, 7:49:14 PM (14 years ago)
Author:
yura
Message:

Word to boolean and back.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/org/refal/plus/Word.java

    r1978 r2284  
    5656        return true;
    5757    }
     58
     59    public boolean boolValue()
     60    {
     61                return Boolean.parseBoolean(str);
     62        }
     63
     64        public static Word valueOf(boolean b)
     65        {
     66                String s = Boolean.toString(b);
     67                return new Word(Character.toUpperCase(s.charAt(0)) + s.substring(1));
     68        }
    5869}
Note: See TracChangeset for help on using the changeset viewer.