Class Controller

All Implemented Interfaces:
Serializable, Comparable<NetworkUser>, GeoLocation, MapEntry, MarkerMapEntry, ViewEntry

public class Controller extends ConnectedUser
A bean to store online Controller information.
Since:
1.0
Version:
11.2
Author:
Luke
See Also:
  • Field Details

  • Constructor Details

    • Controller

      public Controller(int id, OnlineNetwork net)
      Initializes the bean with a particular user ID.
      Parameters:
      id - the user ID
      net - the OnlineNetwork
  • Method Details

    • getType

      public final NetworkUser.Type getType()
      Description copied from class: NetworkUser
      Returns the user type.
      Specified by:
      getType in class NetworkUser
      Returns:
      the Type
    • getFrequency

      public String getFrequency()
      Returns the Controller's communication frequency.
      Returns:
      the frequency
      See Also:
    • getFacility

      public Facility getFacility()
      Returns the Controller's facility type code.
      Returns:
      the facility code
      See Also:
    • getRange

      public int getRange()
      Returns the Controller's visibility range.
      Returns:
      the range in miles
      See Also:
    • getRadios

      public Collection<RadioPosition> getRadios()
      Returns all of the radio positions for this Controller.
      Returns:
      a Collection of RadioPosition beans
    • getFrequencies

      public Collection<String> getFrequencies()
      Returns all of the radio frequencies for this Controller.
      Returns:
      a Collection of frequencies
    • addPosition

      public void addPosition(RadioPosition rp)
      Adds a radio position for this Controller.
      Parameters:
      rp - a RadioPosition
    • setName

      public final void setName(String name)
      Description copied from class: NetworkUser
      Updates the network user's name, stripping off the home airport.
      Overrides:
      setName in class NetworkUser
      Parameters:
      name - the user name
      See Also:
    • setCallsign

      public void setCallsign(String cs)
      Description copied from class: ConnectedUser
      Updates the user's callsign.
      Overrides:
      setCallsign in class ConnectedUser
      Parameters:
      cs - the callsign
      See Also:
    • setFacility

      public void setFacility(Facility ft)
      Sets the Controller's facility type.
      Parameters:
      ft - the Facility
      See Also:
    • setRange

      public void setRange(int rng)
      Updates the Controller's visibility range.
      Parameters:
      rng - the range in miles
      See Also:
    • isObserver

      public boolean isObserver()
      Returns whether the controller is an Observer.
      Returns:
      TRUE if the Controller has an Observer rating or _OBS callsign
    • hasFrequency

      public boolean hasFrequency()
      Returns whether the Conrtoller has set a primary frequency.
      Returns:
      TRUE if a frequency has been set, otherwise FALSE
      See Also:
    • getIconColor

      public String getIconColor()
      Description copied from interface: MarkerMapEntry
      Returns the icon color for this entry if displayed in a Google Map.
      Returns:
      the icon color
    • compareTo

      public int compareTo(Controller c2)
      Compares this user to another Controller by comparing the Network IDs and callsigns.
      Parameters:
      c2 - the Controller
      Returns:
      TRUE if the IDs and Callsigns are equal, otherwise FALSE
    • equals

      public final boolean equals(Object o2)
      Overrides:
      equals in class NetworkUser
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class NetworkUser
    • getInfoBox

      public String getInfoBox()
      Description copied from interface: MapEntry
      Returns the text to display in this marker's infobox if displayed in a Google Map.
      Returns:
      the infobox HTML text, or null if no infobox to be displayed