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

« back to all changes in this revision

Viewing changes to mod/convert-to-xsd/src/main/com/thaiopensource/relaxng/output/xsd/basic/AttributeGroup.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.relaxng.output.xsd.basic;
 
2
 
 
3
import com.thaiopensource.relaxng.edit.SourceLocation;
 
4
 
 
5
import java.util.List;
 
6
import java.util.Collections;
 
7
 
 
8
public class AttributeGroup extends AttributeUse {
 
9
  private final List<AttributeUse> children;
 
10
  private static final List<AttributeUse> EMPTY_LIST = Collections.emptyList();
 
11
 
 
12
  public static final AttributeGroup EMPTY = new AttributeGroup(null, null, EMPTY_LIST);
 
13
 
 
14
  public AttributeGroup(SourceLocation location, Annotation annotation, List<AttributeUse> children) {
 
15
    super(location, annotation);
 
16
    this.children = Collections.unmodifiableList(children);
 
17
  }
 
18
 
 
19
  public List<AttributeUse> getChildren() {
 
20
    return children;
 
21
  }
 
22
 
 
23
  public boolean equals(Object obj) {
 
24
    return super.equals(obj) && ((AttributeGroup)obj).children.equals(children);
 
25
  }
 
26
 
 
27
  public int hashCode() {
 
28
    return super.hashCode() ^ children.hashCode();
 
29
  }
 
30
 
 
31
  public <T> T accept(AttributeUseVisitor<T> visitor) {
 
32
    return visitor.visitAttributeGroup(this);
 
33
  }
 
34
}