1 package org.jahia.content.comparators; 2 3 import java.util.Comparator ; 4 import org.jahia.services.containers.ContentContainerList; 5 6 14 15 public class ContainerListByPageComparator implements Comparator { 16 17 public ContainerListByPageComparator() { 18 } 19 20 public int compare(Object o1, Object o2) { 21 ContentContainerList leftContainerList = (ContentContainerList) o1; 22 ContentContainerList rightContainerList = (ContentContainerList) o2; 23 return new Integer (leftContainerList.getPageID()).compareTo(new Integer (rightContainerList.getPageID())); 24 } 25 26 public boolean equals(Object obj) { 27 if (obj instanceof ContainerListByPageComparator) { 28 return true; 29 } else { 30 return false; 31 } 32 } 33 34 } | Popular Tags |