org.openstreetmap.osmosis.core.domain.v0_6
Class RelationMember

java.lang.Object
  extended by org.openstreetmap.osmosis.core.domain.v0_6.RelationMember
All Implemented Interfaces:
java.lang.Comparable<RelationMember>, Storeable

public class RelationMember
extends java.lang.Object
implements java.lang.Comparable<RelationMember>, Storeable

A data class representing a single member within a relation entity.

Author:
Brett Henderson

Constructor Summary
RelationMember(long memberId, EntityType memberType, java.lang.String memberRole)
          Creates a new instance.
RelationMember(StoreReader sr, StoreClassRegister scr)
          Creates a new instance.
 
Method Summary
 int compareTo(RelationMember relationMember)
          Compares this relation member to the specified relation member.
 long getMemberId()
          Returns the id of the member entity.
 java.lang.String getMemberRole()
          Returns the role that this member forms within the relation.
 EntityType getMemberType()
          Returns the type of the member entity.
 void store(StoreWriter sw, StoreClassRegister scr)
          Stores all state to the specified store writer.
 java.lang.String toString()
          $.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationMember

public RelationMember(long memberId,
                      EntityType memberType,
                      java.lang.String memberRole)
Creates a new instance.

Parameters:
memberId - The id of the entity that this member consists of.
memberType - The type of the entity that this member consists of.
memberRole - The role that this member forms within the relation.

RelationMember

public RelationMember(StoreReader sr,
                      StoreClassRegister scr)
Creates a new instance.

Parameters:
sr - The store to read state from.
scr - Maintains the mapping between classes and their identifiers within the store.
Method Detail

store

public void store(StoreWriter sw,
                  StoreClassRegister scr)
Stores all state to the specified store writer.

Specified by:
store in interface Storeable
Parameters:
sw - The writer that persists data to an underlying store.
scr - Maintains the mapping between classes and their identifiers within the store.

compareTo

public int compareTo(RelationMember relationMember)
Compares this relation member to the specified relation member. The relation member comparison is based on a comparison of member type, then member id, then role.

Specified by:
compareTo in interface java.lang.Comparable<RelationMember>
Parameters:
relationMember - The relation member to compare to.
Returns:
0 if equal, < 0 if considered "smaller", and > 0 if considered "bigger".

getMemberId

public long getMemberId()
Returns the id of the member entity.

Returns:
The member id.

getMemberType

public EntityType getMemberType()
Returns the type of the member entity.

Returns:
The member type.

getMemberRole

public java.lang.String getMemberRole()
Returns the role that this member forms within the relation.

Returns:
The role.

toString

public java.lang.String toString()
$.

Overrides:
toString in class java.lang.Object