|
JmDNS 3.4.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<String,List<? extends DNSEntry>>
javax.jmdns.impl.DNSCache
public class DNSCache
A table of DNS entries. This is a map table which can handle multiple entries with the same name.
Storing multiple entries with the same name is implemented using a linked list. This is hidden from the user and can change in later implementation. Here's how to iterate over all entries:
for (Iterator i=dnscache.allValues().iterator(); i.hasNext(); ) {
DNSEntry entry = i.next();
...do something with entry...
}
And here's how to iterate over all entries having a given name:
for (Iterator i=dnscache.getDNSEntryList(name).iterator(); i.hasNext(); ) {
DNSEntry entry = i.next();
...do something with entry...
}
| Nested Class Summary | |
|---|---|
protected static class |
DNSCache._CacheEntry
|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
static DNSCache |
EmptyCache
|
| Constructor Summary | |
|---|---|
DNSCache()
|
|
DNSCache(DNSCache map)
|
|
DNSCache(int initialCapacity)
Create a table with a given initial size. |
|
| Method Summary | |
|---|---|
boolean |
addDNSEntry(DNSEntry dnsEntry)
Adds an entry to the table. |
Collection<DNSEntry> |
allValues()
Returns all entries in the cache |
protected Object |
clone()
|
Set<Map.Entry<String,List<? extends DNSEntry>>> |
entrySet()
|
DNSEntry |
getDNSEntry(DNSEntry dnsEntry)
Get a matching DNS entry from the table (using isSameEntry). |
DNSEntry |
getDNSEntry(String name,
DNSRecordType type,
DNSRecordClass recordClass)
Get a matching DNS entry from the table. |
Collection<? extends DNSEntry> |
getDNSEntryList(String name)
Iterate only over items with matching name. |
Collection<? extends DNSEntry> |
getDNSEntryList(String name,
DNSRecordType type,
DNSRecordClass recordClass)
Get all matching DNS entries from the table. |
protected Map.Entry<String,List<? extends DNSEntry>> |
getEntry(String key)
|
List<? extends DNSEntry> |
put(String key,
List<? extends DNSEntry> value)
|
boolean |
removeDNSEntry(DNSEntry dnsEntry)
Removes a specific entry from the table. |
boolean |
replaceDNSEntry(DNSEntry newDNSEntry,
DNSEntry existingDNSEntry)
Replace an existing entry by a new one. Note: the 2 entries must have the same key. |
String |
toString()
|
| Methods inherited from class java.util.AbstractMap |
|---|
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DNSCache EmptyCache
| Constructor Detail |
|---|
public DNSCache()
public DNSCache(DNSCache map)
map - public DNSCache(int initialCapacity)
initialCapacity - | Method Detail |
|---|
public Set<Map.Entry<String,List<? extends DNSEntry>>> entrySet()
entrySet in interface Map<String,List<? extends DNSEntry>>entrySet in class AbstractMap<String,List<? extends DNSEntry>>protected Map.Entry<String,List<? extends DNSEntry>> getEntry(String key)
key -
public List<? extends DNSEntry> put(String key,
List<? extends DNSEntry> value)
put in interface Map<String,List<? extends DNSEntry>>put in class AbstractMap<String,List<? extends DNSEntry>>
protected Object clone()
throws CloneNotSupportedException
clone in class AbstractMap<String,List<? extends DNSEntry>>CloneNotSupportedExceptionpublic Collection<DNSEntry> allValues()
public Collection<? extends DNSEntry> getDNSEntryList(String name)
name -
public DNSEntry getDNSEntry(DNSEntry dnsEntry)
dnsEntry -
public DNSEntry getDNSEntry(String name,
DNSRecordType type,
DNSRecordClass recordClass)
name - type - recordClass -
public Collection<? extends DNSEntry> getDNSEntryList(String name,
DNSRecordType type,
DNSRecordClass recordClass)
name - type - recordClass -
public boolean addDNSEntry(DNSEntry dnsEntry)
dnsEntry -
public boolean removeDNSEntry(DNSEntry dnsEntry)
dnsEntry -
public boolean replaceDNSEntry(DNSEntry newDNSEntry,
DNSEntry existingDNSEntry)
newDNSEntry - existingDNSEntry -
true if the entry has been replace, false otherwise.public String toString()
toString in class AbstractMap<String,List<? extends DNSEntry>>
|
Last updated 2011-08-25 12:40 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||