/** * Computes a hashcode based on the value */ public int hashCode() { if (hashcode != 0) return (hashcode); int code = 0; for (int i = offset(0); i < name.length; i++) code += ((code << 3) + lowercase[(name[i] & 0xFF)]); hashcode = code; return hashcode; }
/** * Computes a hashcode based on the value */ public int hashCode() { if (hashcode != 0) return (hashcode); int code = 0; for (int i = offset(0); i < name.length; i++) code += ((code << 3) + lowercase[(name[i] & 0xFF)]); hashcode = code; return hashcode; }
/** * Computes a hashcode based on the value */ public int hashCode() { if (hashcode != 0) return (hashcode); int code = 0; for (int i = offset(0); i < name.length; i++) code += ((code << 3) + lowercase[(name[i] & 0xFF)]); hashcode = code; return hashcode; }
/** * Retrieve the nth label of a Name. This makes a copy of the label; changing * this does not change the Name. * @param n The label to be retrieved. The first label is 0. */ public byte [] getLabel(int n) { int pos = offset(n); byte len = (byte)(name[pos] + 1); byte [] label = new byte[len]; System.arraycopy(name, pos, label, 0, len); return label; }
/** * Retrieve the nth label of a Name. This makes a copy of the label; changing * this does not change the Name. * @param n The label to be retrieved. The first label is 0. */ public byte [] getLabel(int n) { int pos = offset(n); byte len = (byte)(name[pos] + 1); byte [] label = new byte[len]; System.arraycopy(name, pos, label, 0, len); return label; }
/** * Retrieve the nth label of a Name. This makes a copy of the label; changing * this does not change the Name. * @param n The label to be retrieved. The first label is 0. */ public byte [] getLabel(int n) { int pos = offset(n); byte len = (byte)(name[pos] + 1); byte [] label = new byte[len]; System.arraycopy(name, pos, label, 0, len); return label; }
/** * Retrieve the nth label of a Name. This makes a copy of the label; changing * this does not change the Name. * @param n The label to be retrieved. The first label is 0. */ public byte [] getLabel(int n) { int pos = offset(n); byte len = (byte)(name[pos] + 1); byte [] label = new byte[len]; System.arraycopy(name, pos, label, 0, len); return label; }
/** * Convert the nth label in a Name to a String * @param n The label to be converted to a (printable) String. The first * label is 0. */ public String getLabelString(int n) { int pos = offset(n); return byteString(name, pos); }
/** * The length of the name. */ public short length() { if (getlabels() == 0) return 0; return (short)(name.length - offset(0)); }
/** * Convert the nth label in a Name to a String * @param n The label to be converted to a (printable) String. The first * label is 0. */ public String getLabelString(int n) { int pos = offset(n); return byteString(name, pos); }
/** * The length of the name. */ public short length() { if (getlabels() == 0) return 0; return (short)(name.length - offset(0)); }
/** * Convert the nth label in a Name to a String * @param n The label to be converted to a (printable) String. The first * label is 0. */ public String getLabelString(int n) { int pos = offset(n); return byteString(name, pos); }
/** * The length of the name. */ public short length() { if (getlabels() == 0) return 0; return (short)(name.length - offset(0)); }
/** * The length of the name. */ public short length() { if (getlabels() == 0) return 0; return (short)(name.length - offset(0)); }
/** * Is this name absolute? */ public boolean isAbsolute() { int nlabels = labels(); if (nlabels == 0) return false; return name[offset(nlabels - 1)] == 0; }
/** * Convert the nth label in a Name to a String * @param n The label to be converted to a (printable) String. The first * label is 0. */ public String getLabelString(int n) { int pos = offset(n); return byteString(name, pos); }
/** * Is the current Name a subdomain of the specified name? */ public boolean subdomain(Name domain) { int labels = labels(); int dlabels = domain.labels(); if (dlabels > labels) return false; if (dlabels == labels) return equals(domain); return domain.equals(name, offset(labels - dlabels)); }
/** * Is the current Name a subdomain of the specified name? */ public boolean subdomain(Name domain) { int labels = labels(); int dlabels = domain.labels(); if (dlabels > labels) return false; if (dlabels == labels) return equals(domain); return domain.equals(name, offset(labels - dlabels)); }
/** * Is the current Name a subdomain of the specified name? */ public boolean subdomain(Name domain) { int labels = labels(); int dlabels = domain.labels(); if (dlabels > labels) return false; if (dlabels == labels) return equals(domain); return domain.equals(name, offset(labels - dlabels)); }
/** * Is the current Name a subdomain of the specified name? */ public boolean subdomain(Name domain) { int labels = labels(); int dlabels = domain.labels(); if (dlabels > labels) return false; if (dlabels == labels) return equals(domain); return domain.equals(name, offset(labels - dlabels)); }