/* --------------------------------------------------------- * * __________ D E L T A S C R I P T * * (_________() * * / === / - A fast, dynamic scripting language * * | == | - Version 4.13.11.0 * * / === / - Developed by Adam R. Nelson * * | = = | - 2011-2013 * * / === / - Distributed under GNU LGPL v3 * * (________() - http://github.com/ar-nelson/deltascript * * * * --------------------------------------------------------- */ package com.sector91.delta.script; import java.util.Comparator; import com.sector91.delta.script.objects.DS_Object; public enum Comparators implements Comparator<DS_Object> { WithExceptions { public int compare(DS_Object a, DS_Object b) { try {return a.compare(b);} catch (DScriptErr ex) {throw new RuntimeException(ex);} } }, WithoutExceptions { public int compare(DS_Object a, DS_Object b) { try {return a.compare(b);} catch (Exception ex) {return 0;} } } }