Class DailyOceanicTracks

java.lang.Object
org.deltava.beans.navdata.DailyOceanicTracks
All Implemented Interfaces:
Serializable, Comparable<DailyOceanicTracks>, OceanicTrackInfo

public class DailyOceanicTracks extends Object implements Serializable, Comparable<DailyOceanicTracks>, OceanicTrackInfo
A bean to store a daily collection of Oceanic Tracks.
Since:
3.4
Version:
11.0
Author:
Luke
See Also:
  • Constructor Details

    • DailyOceanicTracks

      public DailyOceanicTracks(OceanicTrackInfo.Type t, Instant effDate)
      Creates the bean.
      Parameters:
      t - the Track type
      effDate - the effective date
  • Method Details

    • getDate

      public Instant getDate()
      Description copied from interface: OceanicTrackInfo
      Returns the effective date of the Oceanic.
      Specified by:
      getDate in interface OceanicTrackInfo
      Returns:
      the route date
    • getType

      public OceanicTrackInfo.Type getType()
      Description copied from interface: OceanicTrackInfo
      Returns the route type code.
      Specified by:
      getType in interface OceanicTrackInfo
      Returns:
      the route type
    • size

      public int size()
      Returns the number of OceanicTracks in the collection.
      Returns:
      the number of tracks
    • addTrack

      public void addTrack(OceanicTrack t)
      Adds a Track to this collection.
      Parameters:
      t - an OceanicTrack bean
      Throws:
      NullPointerException - if t is null
      IllegalArgumentException - if the track type or date do not match
    • getTrack

      public OceanicTrack getTrack(String code)
      Returns an Oceanic Track with a specific code
      Parameters:
      code - the Track code, which includes the track type and ID
      Returns:
      an OceanicTrack bean, or null if not found
    • find

      public OceanicTrack find(String startWP, String endWP)
      Find an oceanic track with the specific start and end waypoints.
      Parameters:
      startWP - the starting waypoint code, or null if any
      endWP - the ending waypoint code, or null if any
      Returns:
      an OceanicTrack bean, or null if none found
    • contains

      public boolean contains(String code)
      Returns if any Oceanic Track contains a particular waypoint.
      Parameters:
      code - the waypoint code
      Returns:
      TRUE if any track contains this waypoint, otherwise FALSE
    • getTracks

      public Collection<OceanicTrack> getTracks()
      Returns all of the Track for that day.
      Returns:
      a Collection of OceanicTrack beans
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(DailyOceanicTracks ot2)
      Compares two Track collections by comparing their type and effective dates.
      Specified by:
      compareTo in interface Comparable<DailyOceanicTracks>