public class RelationToChildReference extends java.lang.Object
RelationMember
that stores the parent relation and the index in it in addition to the role/child.Modifier and Type | Field and Description |
---|---|
private OsmPrimitive |
child |
private Relation |
parent |
private int |
position |
private java.lang.String |
role |
Constructor and Description |
---|
RelationToChildReference(Relation parent,
int position,
RelationMember member)
Create a new
RelationToChildReference |
RelationToChildReference(Relation parent,
int position,
java.lang.String role,
OsmPrimitive child)
Create a new
RelationToChildReference |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
OsmPrimitive |
getChild()
Get the actual child
|
Relation |
getParent()
Get the parent relation
|
int |
getPosition()
Get the position of the child in the parent
|
static java.util.Set<RelationToChildReference> |
getRelationToChildReferences(java.util.Collection<? extends OsmPrimitive> children)
Replies a set of all
RelationToChildReference s for a collection of child primitives |
static java.util.Set<RelationToChildReference> |
getRelationToChildReferences(OsmPrimitive child)
Replies a set of all
RelationToChildReference s for a given child primitive. |
java.lang.String |
getRole()
Get the role of the child
|
int |
hashCode() |
private final int position
private final java.lang.String role
private final OsmPrimitive child
public RelationToChildReference(Relation parent, int position, java.lang.String role, OsmPrimitive child)
RelationToChildReference
parent
- The parent relationposition
- The position of the child in the parentrole
- The role of the childchild
- The actual child (member of parent)public RelationToChildReference(Relation parent, int position, RelationMember member)
RelationToChildReference
parent
- The parent relationposition
- The position of the child in the parentmember
- The role and relation for the childpublic static java.util.Set<RelationToChildReference> getRelationToChildReferences(OsmPrimitive child)
RelationToChildReference
s for a given child primitive.child
- the child primitiveRelationToChildReference
s for a given child primitivepublic static java.util.Set<RelationToChildReference> getRelationToChildReferences(java.util.Collection<? extends OsmPrimitive> children)
RelationToChildReference
s for a collection of child primitiveschildren
- the collection of child primitivesRelationToChildReference
s to the children in the collection of child
primitivespublic int getPosition()
public java.lang.String getRole()
public OsmPrimitive getChild()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object