Lines Matching defs:key
65 * Set a key/value pair. Setting an existing key will replace its value.
66 * @param key Must be ascii with no '='
67 * @param value matching value to key
69 public void set(String key, String value) {
83 keyBytes = key.getBytes("US-ASCII");
86 throw new IllegalArgumentException("key should be US-ASCII");
91 throw new IllegalArgumentException("= is not a valid character in key");
99 int currentLoc = remove(key);
107 * Get a value for a key
109 * @param key
110 * @return The value associated with the key
112 public String get(String key) {
113 byte[] val = this.getValue(key);
117 /** Remove a key/value pair. If found, returns the index or -1 if not found */
118 public int remove(String key) {
123 if (key.length() <= avLen &&
124 (key.length() == avLen || mData[avStart + key.length() + 1] == mSeperator)) {
125 String s = new String(mData, avStart + 1, key.length());
126 if (0 == key.compareToIgnoreCase(s)) {
149 /** Return true if key is present, false if not. */
150 public boolean contains(String key) {
153 if (0 == key.compareToIgnoreCase(s)) return true;
193 /** Return a key in the TXT record by zero-based index. Returns null if index exceeds the total number of keys. */
214 * Look up a key in the TXT record by zero-based index and return its value.
216 * Returns null if the key is present with no value.
263 * For a key say like "key3" with null value