home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_std / character_ref.e < prev    next >
Text File  |  1999-06-05  |  2KB  |  70 lines

  1. -- This file is  free  software, which  comes  along  with  SmallEiffel. This
  2. -- software  is  distributed  in the hope that it will be useful, but WITHOUT 
  3. -- ANY  WARRANTY;  without  even  the  implied warranty of MERCHANTABILITY or
  4. -- FITNESS  FOR A PARTICULAR PURPOSE. You can modify it as you want, provided
  5. -- this header is kept unaltered, and a notification of the changes is added.
  6. -- You  are  allowed  to  redistribute  it and sell it, alone or as a part of 
  7. -- another product.
  8. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  9. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  10. --                       http://SmallEiffel.loria.fr
  11. --
  12. class CHARACTER_REF
  13.  
  14. inherit
  15.    HASHABLE;
  16.    COMPARABLE 
  17.       redefine out_in_tagged_out_memory, fill_tagged_out_memory
  18.       end;
  19.    
  20. feature 
  21.    
  22.    item: CHARACTER;
  23.  
  24. feature
  25.    
  26.    set_item(value: like item) is
  27.       do
  28.          item := value;
  29.       end;
  30.  
  31.    infix "<" (other: like Current): BOOLEAN is
  32.       do
  33.          Result := item < other.item
  34.       end;
  35.  
  36.    code: INTEGER is
  37.          -- ASCII code of Current
  38.       do
  39.          Result := item.code
  40.       end;
  41.    
  42.    to_upper: like Current is
  43.          -- Conversion of Current to upper case
  44.       do
  45.          Result := item.to_upper;
  46.       end;
  47.  
  48.    to_lower: like Current is
  49.          -- Conversion of Current to lower case
  50.       do
  51.          Result := item.to_lower;
  52.       end;
  53.  
  54. feature -- Object Printing :
  55.  
  56.    out_in_tagged_out_memory, fill_tagged_out_memory is
  57.       do
  58.          item.fill_tagged_out_memory;
  59.       end;
  60.  
  61. feature -- Hashing :
  62.    
  63.    hash_code: INTEGER is
  64.       do
  65.          Result := item.hash_code;
  66.       end;
  67.  
  68. end -- CHARACTER_REF
  69.  
  70.