| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | UriCanonicalizer.BoundedHashMap
We'll use a bounded map, which should work well for most normal cases, but avoid excesses for degenerate cases (unique URIs used as idenfitiers etc). |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private UriCanonicalizer. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized String | |
| private void |
| mURIs | back to summary |
|---|---|
| private UriCanonicalizer. | |
| UriCanonicalizer | back to summary |
|---|---|
| public UriCanonicalizer() | |
| canonicalizeURI | back to summary |
|---|---|
| public synchronized String canonicalizeURI(char[] ch, int len) | |
| init | back to summary |
|---|---|
| private void init() | |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | DEFAULT_SIZE
Let's create cache big enough to usually have enough space for all/most entries for normal cases, but that won't grow indefinitely for degenerate cases |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | removeEldestEntry(Map.
The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed if this
method returns entrytrue. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.Overrides java. true if this map should remove its eldest entry.
|
| DEFAULT_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_SIZE Let's create cache big enough to usually have enough space for all/most entries for normal cases, but that won't grow indefinitely for degenerate cases | |
| MAX_SIZE | back to summary |
|---|---|
| private static final int MAX_SIZE | |
| BoundedHashMap | back to summary |
|---|---|
| public BoundedHashMap() | |
| removeEldestEntry | back to summary |
|---|---|
| public boolean removeEldestEntry(Map. Overrides java. Doc from java. Returns Sample use: this override will allow the map to grow up to 100 entries and then delete the eldest entry each time a new entry is added, maintaining a steady state of 100 entries.
private static final int MAX_ENTRIES = 100;
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
This method typically does not modify the map in any way,
instead allowing the map to modify itself as directed by its
return value. It is permitted for this method to modify
the map directly, but if it does so, it must return
This implementation merely returns
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final char[] | mChars
Array containing characters of the canonicalized String. |
| pack-priv final int | mHash
Hash of the URI string, calculated using fast(er) hash function (compared to regular String). |
| pack-priv final int | mLength
Length of canonicalized String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static int | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public int | |
| public UriCanonicalizer. | |
| public String |
| mChars | back to summary |
|---|---|
| pack-priv final char[] mChars Array containing characters of the canonicalized String. | |
| mHash | back to summary |
|---|---|
| pack-priv final int mHash Hash of the URI string, calculated using fast(er) hash function (compared to regular String). | |
| mLength | back to summary |
|---|---|
| pack-priv final int mLength Length of canonicalized String | |
| CanonicalKey | back to summary |
|---|---|
| public CanonicalKey(char[] buffer, int len) | |
| CanonicalKey | back to summary |
|---|---|
| public CanonicalKey(char[] buffer, int len, int hashCode) | |
| calcKeyHash | back to summary |
|---|---|
| public static int calcKeyHash(char[] buffer, int len) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| safeClone | back to summary |
|---|---|
| public UriCanonicalizer. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |