| 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 abstract class ParticleGroup extends Particle { |
| 9 |
private final List<Particle> children; |
| 10 |
|
| 11 |
public ParticleGroup(SourceLocation location, Annotation annotation, List<Particle> children) { |
| 12 |
super(location, annotation); |
| 13 |
this.children = Collections.unmodifiableList(children); |
| 14 |
} |
| 15 |
|
| 16 |
public List<Particle> getChildren() { |
| 17 |
return children; |
| 18 |
} |
| 19 |
|
| 20 |
public boolean equals(Object obj) { |
| 21 |
return super.equals(obj) && ((ParticleGroup)obj).children.equals(children); |
| 22 |
} |
| 23 |
|
| 24 |
public int hashCode() { |
| 25 |
return super.hashCode() ^ getChildren().hashCode(); |
| 26 |
} |
| 27 |
} |