Retrieves the position of the given name, if it has been previously included in the message. @param name The name to find in the compression table. @return The position of the name, or -1 if not found.
(Name name)
| 57 | * @return The position of the name, or -1 if not found. |
| 58 | */ |
| 59 | public int |
| 60 | get(Name name) { |
| 61 | int row = (name.hashCode() & 0x7FFFFFFF) % TABLE_SIZE; |
| 62 | int pos = -1; |
| 63 | for (Entry entry = table[row]; entry != null; entry = entry.next) { |
| 64 | if (entry.name.equals(name)) |
| 65 | pos = entry.pos; |
| 66 | } |
| 67 | if (verbose) |
| 68 | System.err.println("Looking for " + name + ", found " + pos); |
| 69 | return pos; |
| 70 | } |
| 71 | |
| 72 | } |