| 1 |
package com.thaiopensource.relaxng.output.xsd.basic; |
| 2 |
|
| 3 |
import com.thaiopensource.relaxng.edit.SourceLocation; |
| 4 |
|
| 5 |
public class ParticleRepeat extends Particle { |
| 6 |
private final Particle child; |
| 7 |
private final Occurs occurs; |
| 8 |
|
| 9 |
public ParticleRepeat(SourceLocation location, Annotation annotation, Particle child, Occurs occurs) { |
| 10 |
super(location, annotation); |
| 11 |
this.child = child; |
| 12 |
this.occurs = occurs; |
| 13 |
} |
| 14 |
|
| 15 |
public Particle getChild() { |
| 16 |
return child; |
| 17 |
} |
| 18 |
|
| 19 |
public Occurs getOccurs() { |
| 20 |
return occurs; |
| 21 |
} |
| 22 |
|
| 23 |
public <T> T accept(ParticleVisitor<T> visitor) { |
| 24 |
return visitor.visitRepeat(this); |
| 25 |
} |
| 26 |
|
| 27 |
public boolean equals(Object obj) { |
| 28 |
if (!super.equals(obj)) |
| 29 |
return false; |
| 30 |
ParticleRepeat other = (ParticleRepeat)obj; |
| 31 |
return this.child.equals(other.child) && this.occurs.equals(other.occurs); |
| 32 |
} |
| 33 |
|
| 34 |
public int hashCode() { |
| 35 |
return super.hashCode() ^ child.hashCode() ^ occurs.hashCode(); |
| 36 |
} |
| 37 |
} |