All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.wicp.tams.component.tools.CompartorJson Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package net.wicp.tams.component.tools;

import java.util.Comparator;

import org.apache.tapestry5.json.JSONObject;

/*****
 * 比较两个 JSONObject 对象,这两个对象必须都有 index 域
 * 
 * @author 周俊辉
 * 
 */
public class CompartorJson implements Comparator {

	@Override
	public int compare(JSONObject o1, JSONObject o2) {
		if (o1.has("index") && o2.has("index")) {
			return o1.getInt("index") - o2.getInt("index");
		}
		return 0;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy