public class PriorityFirstComparator extends Object implements Comparator<ResourceAggregator.RecordedHeaderItem>, Serializable
HeaderItems. PriorityHeaderItems are
moved to the front, inverting the component order to convert the child-first into a parent-first
order. If renderPageFirst is true, the head from the markup of a page is moved to the
front of the header, directly after the priority header items.| Modifier and Type | Class and Description |
|---|---|
protected static class |
PriorityFirstComparator.HeaderItemType |
| Constructor and Description |
|---|
PriorityFirstComparator(boolean renderPageFirst)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(ResourceAggregator.RecordedHeaderItem o1,
ResourceAggregator.RecordedHeaderItem o2) |
protected int |
compareWithinGroup(ResourceAggregator.RecordedHeaderItem o1,
ResourceAggregator.RecordedHeaderItem o2)
Compares two header items that belong in the same group.
|
protected PriorityFirstComparator.HeaderItemType |
getItemType(ResourceAggregator.RecordedHeaderItem item)
Determines the type of the item: priority, page or component.
|
protected int |
inversedComponentOrder(ResourceAggregator.RecordedHeaderItem o1,
ResourceAggregator.RecordedHeaderItem o2)
Compares two priority header items, converting the child-first order into parent-first.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalspublic PriorityFirstComparator(boolean renderPageFirst)
renderPageFirst - when true, the header of the page is moved to the front.public int compare(ResourceAggregator.RecordedHeaderItem o1, ResourceAggregator.RecordedHeaderItem o2)
compare in interface Comparator<ResourceAggregator.RecordedHeaderItem>protected int compareWithinGroup(ResourceAggregator.RecordedHeaderItem o1, ResourceAggregator.RecordedHeaderItem o2)
o1 - o2 - protected int inversedComponentOrder(ResourceAggregator.RecordedHeaderItem o1, ResourceAggregator.RecordedHeaderItem o2)
o1 - o2 - protected PriorityFirstComparator.HeaderItemType getItemType(ResourceAggregator.RecordedHeaderItem item)
item - Copyright © 2006–2014 Apache Software Foundation. All rights reserved.