javax.jmdns.impl
public class DNSCache extends java.util.AbstractMap<java.lang.String,java.util.List<? extends DNSEntry>>
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... }
Modifier and Type | Class and Description |
---|---|
protected static class |
DNSCache._CacheEntry |
Modifier and Type | Field and Description |
---|---|
static DNSCache |
EmptyCache |
Constructor and Description |
---|
DNSCache() |
DNSCache(DNSCache map) |
DNSCache(int initialCapacity)
Create a table with a given initial size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addDNSEntry(DNSEntry dnsEntry)
Adds an entry to the table.
|
java.util.Collection<DNSEntry> |
allValues()
Returns all entries in the cache
|
protected java.lang.Object |
clone() |
java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<? extends DNSEntry>>> |
entrySet() |
DNSEntry |
getDNSEntry(DNSEntry dnsEntry)
Get a matching DNS entry from the table (using isSameEntry).
|
DNSEntry |
getDNSEntry(java.lang.String name,
javax.jmdns.impl.constants.DNSRecordType type,
javax.jmdns.impl.constants.DNSRecordClass recordClass)
Get a matching DNS entry from the table.
|
java.util.Collection<? extends DNSEntry> |
getDNSEntryList(java.lang.String name)
Iterate only over items with matching name.
|
java.util.Collection<? extends DNSEntry> |
getDNSEntryList(java.lang.String name,
javax.jmdns.impl.constants.DNSRecordType type,
javax.jmdns.impl.constants.DNSRecordClass recordClass)
Get all matching DNS entries from the table.
|
protected java.util.Map.Entry<java.lang.String,java.util.List<? extends DNSEntry>> |
getEntry(java.lang.String key) |
java.util.List<? extends DNSEntry> |
put(java.lang.String key,
java.util.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. |
java.lang.String |
toString() |
public static final DNSCache EmptyCache
public DNSCache()
public DNSCache(DNSCache map)
map
- public DNSCache(int initialCapacity)
initialCapacity
- public java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<? extends DNSEntry>>> entrySet()
protected java.util.Map.Entry<java.lang.String,java.util.List<? extends DNSEntry>> getEntry(java.lang.String key)
key
- public java.util.List<? extends DNSEntry> put(java.lang.String key, java.util.List<? extends DNSEntry> value)
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.util.AbstractMap<java.lang.String,java.util.List<? extends DNSEntry>>
java.lang.CloneNotSupportedException
public java.util.Collection<DNSEntry> allValues()
public java.util.Collection<? extends DNSEntry> getDNSEntryList(java.lang.String name)
name
- public DNSEntry getDNSEntry(DNSEntry dnsEntry)
dnsEntry
- public DNSEntry getDNSEntry(java.lang.String name, javax.jmdns.impl.constants.DNSRecordType type, javax.jmdns.impl.constants.DNSRecordClass recordClass)
name
- type
- recordClass
- public java.util.Collection<? extends DNSEntry> getDNSEntryList(java.lang.String name, javax.jmdns.impl.constants.DNSRecordType type, javax.jmdns.impl.constants.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 java.lang.String toString()
toString
in class java.util.AbstractMap<java.lang.String,java.util.List<? extends DNSEntry>>