javax.jmdns.impl
Class DNSEntry

java.lang.Object
  extended by javax.jmdns.impl.DNSEntry
Direct Known Subclasses:
DNSQuestion, DNSRecord

public abstract class DNSEntry
extends java.lang.Object

DNS entry with a name, type, and class. This is the base class for questions and records.


Method Summary
 int compareTo(DNSEntry that)
          Does a lexicographic comparison of the byte array representation of this record and that record.
 boolean equals(java.lang.Object obj)
          Check if two entries have exactly the same name, type, and class.
 java.lang.String getKey()
          Returns the key for this entry.
 java.lang.String getName()
          Returns teh name of this entry
 javax.jmdns.impl.constants.DNSRecordClass getRecordClass()
           
 javax.jmdns.impl.constants.DNSRecordType getRecordType()
           
 int hashCode()
          Overriden, to return a value which is consistent with the value returned by equals(Object).
 boolean isUnique()
           
 void setName(java.lang.String value)
           
protected  byte[] toByteArray()
          Creates a byte array representation of this record.
protected  void toByteArray(java.io.DataOutputStream dout)
           
 java.lang.String toString()
           
 void toString(java.lang.StringBuilder aLog)
           
 java.lang.String toString(java.lang.String hdr, java.lang.String other)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(java.lang.Object obj)
Check if two entries have exactly the same name, type, and class.

Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()
Returns teh name of this entry

Returns:
name of this entry

getKey

public java.lang.String getKey()
Returns the key for this entry. The key is the lower case name.

Returns:
key for this entry

setName

public void setName(java.lang.String value)
Parameters:
value -

getRecordType

public javax.jmdns.impl.constants.DNSRecordType getRecordType()
Returns:
record type

getRecordClass

public javax.jmdns.impl.constants.DNSRecordClass getRecordClass()
Returns:
record class

isUnique

public boolean isUnique()
Returns:
true if unique

toByteArray

protected void toByteArray(java.io.DataOutputStream dout)
                    throws java.io.IOException
Parameters:
dout -
Throws:
java.io.IOException

toByteArray

protected byte[] toByteArray()
Creates a byte array representation of this record. This is needed for tie-break tests according to draft-cheshire-dnsext-multicastdns-04.txt chapter 9.2.

Returns:
byte array representation

compareTo

public int compareTo(DNSEntry that)
Does a lexicographic comparison of the byte array representation of this record and that record. This is needed for tie-break tests according to draft-cheshire-dnsext-multicastdns-04.txt chapter 9.2.

Parameters:
that -
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

hashCode

public int hashCode()
Overriden, to return a value which is consistent with the value returned by equals(Object).

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public void toString(java.lang.StringBuilder aLog)
Parameters:
aLog -

toString

public java.lang.String toString(java.lang.String hdr,
                                 java.lang.String other)