1 18 package org.apache.beehive.netui.core.urls; 19 20 24 public class URLType 25 { 26 protected static final int INT_ACTION = 0; 27 protected static final int INT_RESOURCE = 1; 28 29 public static final URLType ACTION = new URLType( INT_ACTION ); 30 public static final URLType RESOURCE = new URLType( INT_RESOURCE ); 31 32 private int _val; 33 34 private URLType( int val ) 35 { 36 _val = val; 37 } 38 39 public String toString() 40 { 41 switch ( _val ) 42 { 43 case INT_ACTION: return "action"; 44 case INT_RESOURCE: return "resource"; 45 } 46 47 assert false : _val; 48 return "<unknown URLType>"; 49 } 50 51 public boolean equals( Object o ) 52 { 53 if ( o == null ) return false; 54 if ( o == this ) return true; 55 if ( ! ( o instanceof URLType ) ) return false; 56 return ( ( URLType ) o )._val == _val; 57 } 58 59 public int hashCode() 60 { 61 return _val; 62 } 63 } 64 | Popular Tags |