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 ofRelationMemberthat 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 newRelationToChildReferenceRelationToChildReference(Relation parent, int position, RelationMember member)Create a newRelationToChildReference
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)OsmPrimitivegetChild()Get the actual childRelationgetParent()Get the parent relationintgetPosition()Get the position of the child in the parentstatic java.util.Set<RelationToChildReference>getRelationToChildReferences(java.util.Collection<? extends OsmPrimitive> children)Replies a set of allRelationToChildReferences for a collection of child primitivesstatic java.util.Set<RelationToChildReference>getRelationToChildReferences(OsmPrimitive child)Replies a set of allRelationToChildReferences for a given child primitive.java.lang.StringgetRole()Get the role of the childinthashCode()
-
-
-
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 allRelationToChildReferences for a given child primitive.- Parameters:
child- the child primitive- Returns:
- a set of all
RelationToChildReferences for a given child primitive
-
getRelationToChildReferences
public static java.util.Set<RelationToChildReference> getRelationToChildReferences(java.util.Collection<? extends OsmPrimitive> children)
Replies a set of allRelationToChildReferences for a collection of child primitives- Parameters:
children- the collection of child primitives- Returns:
- a set of all
RelationToChildReferences 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-