Class Properties

All Implemented Interfaces:
Serializable, Map<String,Object>

final class Properties extends AbstractMap<String,Object> implements Serializable
An immutable map fetching all properties from the specified identified object. Calls to get methods are forwarded to the appropriate IdentifiedObject method. This map does not contain null value. Collections are converted to arrays.

This map is read-only. Whether it is serializable, immutable or thread-safe depends if the underlying IdentifiedObject instance is itself serializable, immutable or thread-safe.

Since:
0.4
Version:
1.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • KEYS

      private static final String[] KEYS
      The keys to search for. The index of each element in this array must matches the index searched by getAt(int). In other words, this array performs the reverse mapping of INDICES.
    • INDICES

      private static final Map<String,Integer> INDICES
      The mapping from key names to the index expected by the getAt(int) method. This map shall not be modified after construction (for multi-thread safety without synchronization).
    • object

      final org.opengis.referencing.IdentifiedObject object
      The object where all properties come from.
    • excludeMask

      final int excludeMask
      The bitmask of properties to exclude.
  • Constructor Details

    • Properties

      Properties(org.opengis.referencing.IdentifiedObject object, String[] excludes)
      Creates new properties from the specified identified object.
  • Method Details

    • getAt

      final Object getAt(int key)
      Returns the value to which this map maps the specified index. Returns null if the map contains no mapping for the given index.
      Parameters:
      key - the property index, as one of the values in the INDICES map.
    • isEmpty

      public boolean isEmpty()
      Returns false if this map contains at least one element, or true otherwise.
      Specified by:
      isEmpty in interface Map<String,Object>
      Overrides:
      isEmpty in class AbstractMap<String,Object>
      Returns:
      true if this map contains no element.
    • size

      public int size()
      Returns the number of non-null properties in this map.
      Specified by:
      size in interface Map<String,Object>
      Overrides:
      size in class AbstractMap<String,Object>
    • get

      public Object get(Object key)
      Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key.
      Specified by:
      get in interface Map<String,Object>
    • entryIterator

      protected AbstractMap.EntryIterator<String,Object> entryIterator()
      Iterates over the KEYS, returning only the entry having a non-null value.
      Specified by:
      entryIterator in class AbstractMap<String,Object>
      Returns:
      an iterator over the entries in this map, or null.