Class FlightAdapter

  • All Implemented Interfaces:
    android.widget.Adapter, android.widget.ListAdapter, android.widget.SpinnerAdapter

    public class FlightAdapter
    extends android.widget.BaseAdapter
    the purpose of this class is to adapt the flight objects into a layout for the flight pages functionality
    Author:
    Saiyara Iftekharuzzaman
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  FlightAdapter.ViewHolder
      this class takes the xml page items and makes them into variables for the adapter to use
    • Field Summary

      • Fields inherited from interface android.widget.Adapter

        IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
    • Constructor Summary

      Constructors 
      Constructor Description
      FlightAdapter​(android.content.Context context, List<Flight> flightList)
      constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void filter​(String charText)
      filters the list by user search
      int getCount()
      returns the size of the flight list
      Object getItem​(int i)
      returns a flight object
      long getItemId​(int i)
      returns the list item index
      android.view.View getView​(int position, android.view.View view, android.view.ViewGroup parent)
      sets the flight object information into a specific flight row layout that was created
      • Methods inherited from class android.widget.BaseAdapter

        areAllItemsEnabled, getAutofillOptions, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
    • Constructor Detail

      • FlightAdapter

        public FlightAdapter​(android.content.Context context,
                             List<Flight> flightList)
        constructor
        Parameters:
        context - current context
        flightList - list of flights that need to be put into the layout
    • Method Detail

      • getCount

        public int getCount()
        returns the size of the flight list
        Returns:
        the flight list size
      • getItem

        public Object getItem​(int i)
        returns a flight object
        Parameters:
        i - takes an index
        Returns:
        the specific flight at that index
      • getItemId

        public long getItemId​(int i)
        returns the list item index
        Parameters:
        i - index of item
        Returns:
        index
      • getView

        public android.view.View getView​(int position,
                                         android.view.View view,
                                         android.view.ViewGroup parent)
        sets the flight object information into a specific flight row layout that was created
        Parameters:
        position - flight row's position
        view - current flight row view
        parent - flight row parent
        Returns:
        view
      • filter

        public void filter​(String charText)
        filters the list by user search
        Parameters:
        charText - character the user inputs