Package org.simpleframework.http.parse
Class ListParser.Entry
- java.lang.Object
-
- org.simpleframework.http.parse.ListParser.Entry
-
- All Implemented Interfaces:
java.lang.Comparable<ListParser.Entry>
- Enclosing class:
- ListParser<T>
private class ListParser.Entry extends java.lang.Object implements java.lang.Comparable<ListParser.Entry>
TheEntry
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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ListParser.Entry entry)
This is used to sort the entries within the priority queue using the provided priority of specified.T
getValue()
This acquires the value represented by this entry.
-
-
-
Field Detail
-
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 Detail
-
Entry
public Entry(T value, long priority, int order)
Constructor for theEntry
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 thispriority
- this is the priority value for sortingorder
- this is the secondary priority value used
-
-
Method Detail
-
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.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 interfacejava.lang.Comparable<ListParser.Entry>
- Parameters:
entry
- this is the entry to be compared to- Returns:
- this returns the result of the entry comparison
-
-