~ubuntu-branches/ubuntu/wily/dnsjava/wily-proposed

« back to all changes in this revision

Viewing changes to org/xbill/DNS/SingleNameBase.java

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2009-07-21 15:17:03 UTC
  • Revision ID: james.westby@ubuntu.com-20090721151703-6v0107p1s3h7gv1c
Tags: upstream-2.0.6
ImportĀ upstreamĀ versionĀ 2.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2004 Brian Wellington (bwelling@xbill.org)
 
2
 
 
3
package org.xbill.DNS;
 
4
 
 
5
import java.io.*;
 
6
 
 
7
/**
 
8
 * Implements common functionality for the many record types whose format
 
9
 * is a single name.
 
10
 *
 
11
 * @author Brian Wellington
 
12
 */
 
13
 
 
14
abstract class SingleNameBase extends Record {
 
15
 
 
16
protected Name singleName;
 
17
 
 
18
protected
 
19
SingleNameBase() {}
 
20
 
 
21
protected
 
22
SingleNameBase(Name name, int type, int dclass, long ttl) {
 
23
        super(name, type, dclass, ttl);
 
24
}
 
25
 
 
26
protected
 
27
SingleNameBase(Name name, int type, int dclass, long ttl, Name singleName,
 
28
            String description)
 
29
{
 
30
        super(name, type, dclass, ttl);
 
31
        this.singleName = checkName(description, singleName);
 
32
}
 
33
 
 
34
void
 
35
rrFromWire(DNSInput in) throws IOException {
 
36
        singleName = new Name(in);
 
37
}
 
38
 
 
39
void
 
40
rdataFromString(Tokenizer st, Name origin) throws IOException {
 
41
        singleName = st.getName(origin);
 
42
}
 
43
 
 
44
String
 
45
rrToString() {
 
46
        return singleName.toString();
 
47
}
 
48
 
 
49
protected Name
 
50
getSingleName() {
 
51
        return singleName;
 
52
}
 
53
 
 
54
void
 
55
rrToWire(DNSOutput out, Compression c, boolean canonical) {
 
56
        singleName.toWire(out, null, canonical);
 
57
}
 
58
 
 
59
}