Class ReaderElement

java.lang.Object
com.graphhopper.reader.ReaderElement
Direct Known Subclasses:
OSMFileHeader, ReaderNode, ReaderRelation, ReaderWay

public abstract class ReaderElement extends Object
Base class for all network objects

Author:
Nop, Peter
  • Constructor Details

  • Method Details

    • getId

      public long getId()
    • tagsToString

      protected String tagsToString()
    • getTags

      public Map<String,Object> getTags()
    • setTags

      public void setTags(Map<String,Object> newTags)
    • hasTags

      public boolean hasTags()
    • getTag

      public String getTag(String name)
    • getTag

      public <T> T getTag(String key, T defaultValue)
    • setTag

      public void setTag(String name, Object value)
    • hasTag

      public boolean hasTag(String key, Object value)
      Check that the object has a given tag with a given value.
    • hasTag

      public boolean hasTag(String key, String... values)
      Check that a given tag has one of the specified values. If no values are given, just checks for presence of the tag
    • hasTag

      public final boolean hasTag(String key, Collection<String> values)
      Check that a given tag has one of the specified values.
    • hasTag

      public boolean hasTag(List<String> keyList, Collection<String> values)
      Check a number of tags in the given order for any of the given values.
    • hasTag

      public boolean hasTag(List<String> keyList, Object value)
      Check a number of tags in the given order if their value is equal to the specified value.
    • getFirstValue

      public String getFirstValue(List<String> searchedTags)
      Returns the first existing value of the specified list of keys where the order is important.
      Returns:
      an empty string if nothing found
    • getFirstIndex

      public int getFirstIndex(List<String> searchedTags)
      Returns:
      -1 if not found
    • removeTag

      public void removeTag(String name)
    • clearTags

      public void clearTags()
    • getType

      public ReaderElement.Type getType()
    • toString

      public String toString()
      Overrides:
      toString in class Object