コード例 #1
0
ファイル: JsonDouble.java プロジェクト: liuhaibin/jaql
 /* @see com.ibm.jaql.json.type.JsonValue#compareTo(java.lang.Object) */
 @Override
 public int compareTo(Object x) {
   JsonNumber other = (JsonNumber) x;
   JsonType otherType = other.getEncoding().getType();
   switch (otherType) {
     case LONG:
       return compare(this, (JsonLong) other);
     case DOUBLE:
       return compare(this, (JsonDouble) other);
     case DECFLOAT:
       return compare(this, (JsonDecimal) other);
     default:
       throw new IllegalStateException("unknown numeric type " + otherType);
   }
 }