|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xbill.DNS.Name
A representation of a domain name. It may either be absolute (fully qualified) or relative.
| Field Summary | |
static Name |
empty
The root name |
static Name |
root
The root name |
| Constructor Summary | |
Name(byte[] b)
Create a new name from DNS wire format |
|
Name(Name src,
int n)
Create a new name by removing labels from the beginning of an existing Name |
|
Name(String s)
Create a new name from a string. |
|
Name(String s,
Name origin)
Create a new name from a string and an origin. |
|
| Method Summary | |
int |
compareTo(Object o)
Compares this Name to another Object. |
static Name |
concatenate(Name prefix,
Name suffix)
Creates a new name by concatenating two existing names. |
boolean |
equals(Object arg)
Are these two Names equivalent? |
static Name |
fromConstantString(String s)
Create a new name from a constant string. |
Name |
fromDNAME(DNAMERecord dname)
Generates a new Name to be used when following a DNAME. |
static Name |
fromString(String s)
Create a new name from a string. |
static Name |
fromString(String s,
Name origin)
Create a new name from a string and an origin. |
byte[] |
getLabel(int n)
Retrieve the nth label of a Name. |
String |
getLabelString(int n)
Convert the nth label in a Name to a String |
int |
hashCode()
Computes a hashcode based on the value |
boolean |
isAbsolute()
Is this name absolute? |
boolean |
isWild()
Is this name a wildcard? |
int |
labels()
The number of labels in the name. |
short |
length()
The length of the name. |
Name |
relativize(Name origin)
If this name is a subdomain of origin, return a new name relative to origin with the same value. |
boolean |
subdomain(Name domain)
Is the current Name a subdomain of the specified name? |
String |
toString()
Convert Name to a String |
byte[] |
toWire()
Convert Name to DNS wire format |
byte[] |
toWireCanonical()
Convert Name to canonical DNS wire format (all lowercase) |
Name |
wild(int n)
Generates a new Name with the first n labels replaced by a wildcard |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Name root
public static final Name empty
| Constructor Detail |
public Name(String s,
Name origin)
throws TextParseException
s - The string to be convertedorigin - If the name is not absolute, the origin to be appended.
TextParseException - The name is invalid.
public Name(String s)
throws TextParseException
s - The string to be converted
TextParseException - The name is invalid.
public Name(byte[] b)
throws IOException
b - A byte array containing the wire format of the name.
public Name(Name src,
int n)
src - An existing Namen - The number of labels to remove from the beginning in the copy| Method Detail |
public static Name fromString(String s,
Name origin)
throws TextParseException
s - The string to be convertedorigin - If the name is not absolute, the origin to be appended.
TextParseException - The name is invalid.
public static Name fromString(String s)
throws TextParseException
s - The string to be converted
TextParseException - The name is invalid.public static Name fromConstantString(String s)
s - The string to be converted
IllegalArgumentException - The name is invalid.
public static Name concatenate(Name prefix,
Name suffix)
throws NameTooLongException
prefix - The prefix name.suffix - The suffix name.
NameTooLongException - The name is too long.public Name relativize(Name origin)
origin - The origin to remove.
public Name wild(int n)
public Name fromDNAME(DNAMERecord dname)
throws NameTooLongException
dname - The DNAME record to follow.
NameTooLongException - The resulting name is too long.public boolean isWild()
public boolean isAbsolute()
public short length()
public int labels()
public boolean subdomain(Name domain)
public String toString()
public byte[] getLabel(int n)
n - The label to be retrieved. The first label is 0.public String getLabelString(int n)
n - The label to be converted to a String. The first label is 0.public byte[] toWire()
IllegalArgumentException - The name is not absolute.public byte[] toWireCanonical()
public boolean equals(Object arg)
public int hashCode()
public int compareTo(Object o)
compareTo in interface Comparableo - The Object to be compared.
ClassCastException - if the argument is not a Name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||