1 26 27 package org.objectweb.openccm.Components; 28 29 37 38 public class CookieImpl 39 extends org.omg.Components.Cookie 40 { 41 47 50 private String random_ = "RANDOM NOT COMPUTED"; 51 52 58 61 public 62 CookieImpl() 63 { 64 } 65 66 71 public 72 CookieImpl(String random) 73 { 74 random_ = random; 75 cookieValue = random.getBytes(); 77 } 78 79 85 88 protected void 89 initAfterRead() 90 { 91 random_ = new String (cookieValue); 92 } 93 94 100 105 public static CookieImpl 106 generate() 107 { 108 String random = java.lang.Double.toString(java.lang.Math.random()); 110 111 CookieImpl result = new CookieImpl(random); 113 114 return result; 116 } 117 118 124 129 public String 130 toString() 131 { 132 return random_; 133 } 134 135 140 public int 141 hashCode() 142 { 143 return random_.hashCode(); 144 } 145 146 149 public boolean 150 equals(Object o) 151 { 152 return random_.equals(((CookieImpl)o).random_); 154 } 155 } 156 | Popular Tags |