Class ListParser.Entry

java.lang.Object
org.simpleframework.http.parse.ListParser.Entry
All Implemented Interfaces:
Comparable<ListParser<T>.Entry>
Enclosing class:
ListParser<T>

private class ListParser.Entry extends Object implements Comparable<ListParser<T>.Entry>
The Entry object provides a comparable object to insert in to a priority queue. This will sort the value using the quality value parameter parsed from the list. If there are values with the same quality value this this will sort the values by a secondary order parameter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    This is the secondary order value used to sort entries.
    private final long
    This is the priority value that is used to sort entries.
    private final T
    This is the value that is represented by this entry.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(T value, long priority, int order)
    Constructor for the Entry object.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    This is used to sort the entries within the priority queue using the provided priority of specified.
    This acquires the value represented by this entry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • value

      private final T value
      This is the value that is represented by this entry.
    • priority

      private final long priority
      This is the priority value that is used to sort entries.
    • order

      private final int order
      This is the secondary order value used to sort entries.
  • Constructor Details

    • Entry

      public Entry(T value, long priority, int order)
      Constructor for the Entry object. This is used to create a comparable value that can be inserted in to a priority queue and extracted in order of the priority value.
      Parameters:
      value - this is the value that is represented by this
      priority - this is the priority value for sorting
      order - this is the secondary priority value used
  • Method Details

    • getValue

      public T getValue()
      This acquires the value represented by this entry. This is can be used to place the value within a list as it is taken from the priority queue. Acquiring the values in this way facilitates a priority ordered list of values.
      Returns:
      this returns the value represented by this
    • compareTo

      public int compareTo(ListParser<T>.Entry entry)
      This is used to sort the entries within the priority queue using the provided priority of specified. If the entries have the same priority value then they are sorted using a secondary order value, which is the insertion index.
      Specified by:
      compareTo in interface Comparable<ListParser<T>.Entry>
      Parameters:
      entry - this is the entry to be compared to
      Returns:
      this returns the result of the entry comparison