~ubuntu-branches/debian/wheezy/jing-trang/wheezy

« back to all changes in this revision

Viewing changes to mod/dtd-parse/src/main/com/thaiopensource/xml/dtd/parse/DtdImpl.java

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Thibault
  • Date: 2009-09-01 15:53:03 UTC
  • Revision ID: james.westby@ubuntu.com-20090901155303-2kweef05h5v9j3ni
Tags: upstream-20090818
ImportĀ upstreamĀ versionĀ 20090818

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.thaiopensource.xml.dtd.parse;
 
2
 
 
3
import java.util.Vector;
 
4
 
 
5
import com.thaiopensource.xml.dtd.om.Dtd;
 
6
import com.thaiopensource.xml.dtd.om.TopLevel;
 
7
import com.thaiopensource.xml.dtd.om.TopLevelVisitor;
 
8
 
 
9
class DtdImpl implements Dtd {
 
10
  private final Vector topLevel;
 
11
  private final String encoding;
 
12
  private final String uri;
 
13
 
 
14
  DtdImpl(Vector topLevel, String uri, String encoding) {
 
15
    this.topLevel = topLevel;
 
16
    this.uri = uri;
 
17
    this.encoding = encoding;
 
18
  }
 
19
 
 
20
  public String getUri() {
 
21
    return uri;
 
22
  }
 
23
    
 
24
  public String getEncoding() {
 
25
    return encoding;
 
26
  }
 
27
 
 
28
  public TopLevel[] getAllTopLevel() {
 
29
    TopLevel[] tem = new TopLevel[topLevel.size()];
 
30
    for (int i = 0; i < tem.length; i++)
 
31
      tem[i] = (TopLevel)topLevel.elementAt(i);
 
32
    return tem;
 
33
  }
 
34
 
 
35
  public void accept(TopLevelVisitor visitor) throws Exception {
 
36
    int n = topLevel.size();
 
37
    for (int i = 0; i < n; i++)
 
38
      ((TopLevel)topLevel.elementAt(i)).accept(visitor);
 
39
  }
 
40
}