Package org.opentrafficsim.swing.gui
Class OTSSearchPanel.ObjectKind<T extends Locatable & org.opentrafficsim.base.Identifiable>
- java.lang.Object
-
- org.opentrafficsim.swing.gui.OTSSearchPanel.ObjectKind<T>
-
- 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 Summary
Constructors Constructor Description ObjectKind(String key)
Construct a new ObjectKind (entry in the combo box).
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
getKey()
Retrieve the key.(package private) abstract T
searchNetwork(org.opentrafficsim.core.network.OTSNetwork network, String id)
Lookup an object of type T in an OTS network.String
toString()
Produce the text that will appear in the combo box.
-
-
-
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 networkid
- 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.
-
-