Class Layer

  • All Implemented Interfaces:
    Destroyable

    public final class Layer
    extends java.lang.Object
    implements Destroyable
    A Mapbox Vector Tile Layer
    Since:
    17862
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Layer.ValueFields<T>  
    • Constructor Summary

      Constructors 
      Constructor Description
      Layer​(byte[] bytes)
      Create a new layer
      Layer​(java.util.Collection<ProtobufRecord> records)
      Create a layer from a collection of records
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Called when the object has been destroyed.
      boolean equals​(java.lang.Object other)  
      private static java.util.Collection<ProtobufRecord> getAllRecords​(byte[] bytes)
      Get all the records from a array of bytes
      int getExtent()
      Get the extent of the tile
      java.util.Collection<Feature> getFeatures()
      Get the feature on this layer
      java.util.Collection<Geometry> getGeometry()
      Get the geometry for this layer
      java.lang.String getKey​(int index)
      Get a specified key
      java.lang.String getName()
      Get the name of the layer
      java.lang.Object getValue​(int index)
      Get a specified value
      byte getVersion()
      Get the Mapbox Vector Tile version specification for this layer
      int hashCode()  
      private void parseValueRecord​(java.io.ByteArrayOutputStream byteArrayOutputStream, ProtobufRecord protobufRecord)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Layer

        public Layer​(java.util.Collection<ProtobufRecord> records)
              throws java.io.IOException
        Create a layer from a collection of records
        Parameters:
        records - The records to convert to a layer
        Throws:
        java.io.IOException - - if an IO error occurs
      • Layer

        public Layer​(byte[] bytes)
              throws java.io.IOException
        Create a new layer
        Parameters:
        bytes - The bytes that the layer comes from
        Throws:
        java.io.IOException - - if an IO error occurs
    • Method Detail

      • parseValueRecord

        private void parseValueRecord​(java.io.ByteArrayOutputStream byteArrayOutputStream,
                                      ProtobufRecord protobufRecord)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getAllRecords

        private static java.util.Collection<ProtobufRecordgetAllRecords​(byte[] bytes)
                                                                   throws java.io.IOException
        Get all the records from a array of bytes
        Parameters:
        bytes - The byte information
        Returns:
        All the protobuf records
        Throws:
        java.io.IOException - If there was an error reading the bytes (unlikely)
      • getExtent

        public int getExtent()
        Get the extent of the tile
        Returns:
        The layer extent
      • getFeatures

        public java.util.Collection<FeaturegetFeatures()
        Get the feature on this layer
        Returns:
        the features
      • getGeometry

        public java.util.Collection<GeometrygetGeometry()
        Get the geometry for this layer
        Returns:
        The geometry
      • getKey

        public java.lang.String getKey​(int index)
        Get a specified key
        Parameters:
        index - The index in the key list
        Returns:
        The actual key
      • getName

        public java.lang.String getName()
        Get the name of the layer
        Returns:
        The layer name
      • getValue

        public java.lang.Object getValue​(int index)
        Get a specified value
        Parameters:
        index - The index in the value list
        Returns:
        The actual value. This can be a String, Boolean, Integer, or Float value.
      • getVersion

        public byte getVersion()
        Get the Mapbox Vector Tile version specification for this layer
        Returns:
        The version of the Mapbox Vector Tile specification
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object