Package org.openstreetmap.josm.data.osm
Class RelationToChildReference
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.RelationToChildReference
-
public class RelationToChildReference extends java.lang.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, java.lang.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(java.lang.Object obj)
OsmPrimitive
getChild()
Get the actual childRelation
getParent()
Get the parent relationint
getPosition()
Get the position of the child in the parentstatic java.util.Set<RelationToChildReference>
getRelationToChildReferences(java.util.Collection<? extends OsmPrimitive> children)
Replies a set of allRelationToChildReference
s for a collection of child primitivesstatic java.util.Set<RelationToChildReference>
getRelationToChildReferences(OsmPrimitive child)
Replies a set of allRelationToChildReference
s for a given child primitive.java.lang.String
getRole()
Get the role of the childint
hashCode()
-
-
-
Constructor Detail
-
RelationToChildReference
public RelationToChildReference(Relation parent, int position, java.lang.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 java.util.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 java.util.Set<RelationToChildReference> getRelationToChildReferences(java.util.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
-
getRole
public java.lang.String getRole()
Get the role of the child- Returns:
- The role
-
getChild
public OsmPrimitive getChild()
Get the actual child- Returns:
- The child
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-