Mercurial Hosting > luan
comparison src/org/eclipse/jetty/io/StringCache.java @ 1020:6be43ef1eb96
HttpHeaderValues uses StringCache
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 31 Oct 2016 22:24:41 -0600 |
parents | f126d30e04a4 |
children | 3718afd99988 |
comparison
equal
deleted
inserted
replaced
1019:f126d30e04a4 | 1020:6be43ef1eb96 |
---|---|
5 import java.util.HashMap; | 5 import java.util.HashMap; |
6 import java.util.Map; | 6 import java.util.Map; |
7 import org.eclipse.jetty.util.StringUtil; | 7 import org.eclipse.jetty.util.StringUtil; |
8 | 8 |
9 | 9 |
10 public class StringCache { | 10 public final class StringCache { |
11 private final Map<String,Integer> stringToOrdinal = new HashMap<String,Integer>(); | 11 private final Map<String,Integer> stringToOrdinal = new HashMap<String,Integer>(); |
12 // private final Map<Integer,String> ordinalToString = new HashMap<Integer,String>(); | 12 // private final Map<Integer,String> ordinalToString = new HashMap<Integer,String>(); |
13 | 13 |
14 public byte[] add(String value, int ordinal) { | 14 public byte[] add(String value, int ordinal) { |
15 stringToOrdinal.put(value.toLowerCase(), ordinal); | 15 stringToOrdinal.put(value.toLowerCase(), ordinal); |