Class OTSSearchPanel.ObjectKind<T extends Locatable & org.opentrafficsim.base.Identifiable>

  • Type Parameters:
    T - Type of object identified by key
    Enclosing class:
    OTSSearchPanel

    abstract static class OTSSearchPanel.ObjectKind<T extends Locatable & org.opentrafficsim.base.Identifiable>
    extends Object
    Entries in the typeToSearch JComboBox of the OTS search panel.
    • Constructor Detail

      • ObjectKind

        ObjectKind​(String key)
        Construct a new ObjectKind (entry in the combo box).
        Parameters:
        key - String; the key of the new ObjectKind
    • Method Detail

      • getKey

        public Object getKey()
        Retrieve the key.
        Returns:
        String; the key
      • searchNetwork

        abstract T searchNetwork​(org.opentrafficsim.core.network.OTSNetwork network,
                                 String id)
        Lookup an object of type T in an OTS network.
        Parameters:
        network - OTSNetwork; the OTS network
        id - String; id of the object to return
        Returns:
        T; the object in the network of the correct type and matching id, or null if no matching object was found.
      • toString

        public String toString()
        Produce the text that will appear in the combo box. This method should be overridden to implement localization.
        Overrides:
        toString in class Object