KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cintoo > messages > context > ContextKey


1 package cintoo.messages.context;
2
3 import api.cintoo.messages.context.Context;
4
5 import java.util.Locale JavaDoc;
6
7 /**
8  * Key to use e.g. for caching for contexts. The keys
9  * use a context and a locale for specification.
10  *
11  * @author Stephan J. Schmidt
12  * @version $id$
13  * @since 1.0
14  */

15 public class ContextKey {
16   public String JavaDoc key;
17
18   public static long generate(Context context, Locale JavaDoc locale) {
19      return (context.toString() + "-" + locale.toString()).hashCode();
20   }
21 }
22
Popular Tags