Package org.openstreetmap.josm.data.osm
Class RelationToChildReference
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.RelationToChildReference
-
public class RelationToChildReference extends Object
This is an extension ofRelationMember
that stores the parent relation and the index in it in addition to the role/child.
-
-
Constructor Summary
Constructors Constructor Description RelationToChildReference(Relation parent, int position, String role, OsmPrimitive child)
Create a newRelationToChildReference
RelationToChildReference(Relation parent, int position, RelationMember member)
Create a newRelationToChildReference
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
OsmPrimitive
getChild()
Get the actual childRelation
getParent()
Get the parent relationint
getPosition()
Get the position of the child in the parentstatic Set<RelationToChildReference>
getRelationToChildReferences(Collection<? extends OsmPrimitive> children)
Replies a set of allRelationToChildReference
s for a collection of child primitivesstatic Set<RelationToChildReference>
getRelationToChildReferences(OsmPrimitive child)
Replies a set of allRelationToChildReference
s for a given child primitive.String
getRole()
Get the role of the childint
hashCode()
-
-
-
Constructor Detail
-
RelationToChildReference
public RelationToChildReference(Relation parent, int position, String role, OsmPrimitive child)
Create a newRelationToChildReference
- Parameters:
parent
- The parent relationposition
- The position of the child in the parentrole
- The role of the childchild
- The actual child (member of parent)
-
RelationToChildReference
public RelationToChildReference(Relation parent, int position, RelationMember member)
Create a newRelationToChildReference
- Parameters:
parent
- The parent relationposition
- The position of the child in the parentmember
- The role and relation for the child
-
-
Method Detail
-
getRelationToChildReferences
public static Set<RelationToChildReference> getRelationToChildReferences(OsmPrimitive child)
Replies a set of allRelationToChildReference
s for a given child primitive.- Parameters:
child
- the child primitive- Returns:
- a set of all
RelationToChildReference
s for a given child primitive
-
getRelationToChildReferences
public static Set<RelationToChildReference> getRelationToChildReferences(Collection<? extends OsmPrimitive> children)
Replies a set of allRelationToChildReference
s for a collection of child primitives- Parameters:
children
- the collection of child primitives- Returns:
- a set of all
RelationToChildReference
s to the children in the collection of child primitives
-
getPosition
public int getPosition()
Get the position of the child in the parent- Returns:
- The position of the child
-
getChild
public OsmPrimitive getChild()
Get the actual child- Returns:
- The child
-
-