| java.lang.Object org.xbill.DNS.Name
Name | public class Name implements Comparable(Code) | | A representation of a domain name. It may either be absolute (fully
qualified) or relative.
author: Brian Wellington |
empty | final public static Name empty(Code) | | The root name
|
root | final public static Name root(Code) | | The root name
|
Name | public Name(String s, Name origin) throws TextParseException(Code) | | Create a new name from a string and an origin. This does not automatically
make the name absolute; it will be absolute if it has a trailing dot or an
absolute origin is appended.
Parameters: s - The string to be converted Parameters: origin - If the name is not absolute, the origin to be appended. throws: TextParseException - The name is invalid. |
Name | public Name(String s) throws TextParseException(Code) | | Create a new name from a string. This does not automatically make the name
absolute; it will be absolute if it has a trailing dot.
Parameters: s - The string to be converted throws: TextParseException - The name is invalid. |
Name | public Name(DNSInput in) throws WireParseException(Code) | | Create a new name from DNS a wire format message
Parameters: in - A stream containing the DNS message which is currentlypositioned at the start of the name to be read. |
Name | public Name(byte[] b) throws IOException(Code) | | Create a new name from DNS wire format
Parameters: b - A byte array containing the wire format of the name. |
Name | public Name(Name src, int n)(Code) | | Create a new name by removing labels from the beginning of an existing Name
Parameters: src - An existing Name Parameters: n - The number of labels to remove from the beginning in the copy |
compareTo | public int compareTo(Object o)(Code) | | Compares this Name to another Object.
Parameters: o - The Object to be compared. The value 0 if the argument is a name equivalent to this name;a value less than 0 if the argument is less than this name in the canonical ordering, and a value greater than 0 if the argument is greater than thisname in the canonical ordering. throws: ClassCastException - if the argument is not a Name. |
concatenate | public static Name concatenate(Name prefix, Name suffix) throws NameTooLongException(Code) | | Creates a new name by concatenating two existing names.
Parameters: prefix - The prefix name. Parameters: suffix - The suffix name. The concatenated name. throws: NameTooLongException - The name is too long. |
equals | public boolean equals(Object arg)(Code) | | Are these two Names equivalent?
|
fromConstantString | public static Name fromConstantString(String s)(Code) | | Create a new name from a constant string. This should only be used when
the name is known to be good - that is, when it is constant.
Parameters: s - The string to be converted throws: IllegalArgumentException - The name is invalid. |
fromString | public static Name fromString(String s, Name origin) throws TextParseException(Code) | | Create a new name from a string and an origin. This does not automatically
make the name absolute; it will be absolute if it has a trailing dot or an
absolute origin is appended. This is identical to the constructor, except
that it will avoid creating new objects in some cases.
Parameters: s - The string to be converted Parameters: origin - If the name is not absolute, the origin to be appended. throws: TextParseException - The name is invalid. |
fromString | public static Name fromString(String s) throws TextParseException(Code) | | Create a new name from a string. This does not automatically make the name
absolute; it will be absolute if it has a trailing dot. This is identical
to the constructor, except that it will avoid creating new objects in some
cases.
Parameters: s - The string to be converted throws: TextParseException - The name is invalid. |
getLabel | public byte[] getLabel(int n)(Code) | | Retrieve the nth label of a Name. This makes a copy of the label; changing
this does not change the Name.
Parameters: n - The label to be retrieved. The first label is 0. |
getLabelString | public String getLabelString(int n)(Code) | | Convert the nth label in a Name to a String
Parameters: n - The label to be converted to a (printable) String. The firstlabel is 0. |
hashCode | public int hashCode()(Code) | | Computes a hashcode based on the value
|
isAbsolute | public boolean isAbsolute()(Code) | | Is this name absolute?
|
isWild | public boolean isWild()(Code) | | Is this name a wildcard?
|
labels | public int labels()(Code) | | The number of labels in the name.
|
length | public short length()(Code) | | The length of the name.
|
relativize | public Name relativize(Name origin)(Code) | | If this name is a subdomain of origin, return a new name relative to
origin with the same value. Otherwise, return the existing name.
Parameters: origin - The origin to remove. The possibly relativized name. |
subdomain | public boolean subdomain(Name domain)(Code) | | Is the current Name a subdomain of the specified name?
|
toString | public String toString()(Code) | | Convert a Name to a String
The representation of this name as a (printable) String. |
toWire | public void toWire(DNSOutput out, Compression c)(Code) | | Emit a Name in DNS wire format
Parameters: out - The output stream containing the DNS message. Parameters: c - The compression context, or null of no compression is desired. throws: IllegalArgumentException - The name is not absolute. |
toWire | public void toWire(DNSOutput out, Compression c, boolean canonical)(Code) | | Emit a Name in DNS wire format
Parameters: out - The output stream containing the DNS message. Parameters: c - The compression context, or null of no compression is desired. Parameters: canonical - If true, emit the name in canonicalized form(all lowercase). throws: IllegalArgumentException - The name is not absolute. |
toWireCanonical | public void toWireCanonical(DNSOutput out)(Code) | | Emit a Name in canonical DNS wire format (all lowercase)
Parameters: out - The output stream to which the message is written. |
toWireCanonical | public byte[] toWireCanonical()(Code) | | Emit a Name in canonical DNS wire format (all lowercase)
The canonical form of the name. |
wild | public Name wild(int n)(Code) | | Generates a new Name with the first n labels replaced by a wildcard
The wildcard name |
|
|