@Override public void operateIntegerInteger(LongPointable longp, LongPointable longp2, DataOutput dOut) throws SystemException, IOException { if (longp.getLong() == 0) { throw new SystemException(ErrorCode.FOAR0001); } long value = longp.getLong(); value /= longp2.getLong(); dOut.write(ValueTag.XS_INTEGER_TAG); dOut.writeLong(value); }
@Override public void operateInteger(LongPointable longp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_INTEGER_TAG); dOut.writeLong(longp.getLong()); } }
@Override public void operateInteger(LongPointable longp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_INTEGER_TAG); dOut.writeLong(longp.getLong()); } }
@Override public void operateInteger(LongPointable longp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_INTEGER_TAG); dOut.writeLong(Math.abs(longp.getLong())); } }
@Override public void convertDTDuration(LongPointable longp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_DURATION_TAG); dOut.writeInt(0); dOut.writeLong(longp.getLong()); }
@Override public void normalize(byte[] bytes, int start, int length, int[] normalizedKeys, int keyStart) { long value = LongPointable.getLong(bytes, start); value = value ^ Long.MIN_VALUE; NormalizedKeyUtils.putLongIntoNormalizedKeys(normalizedKeys, keyStart, value); }
@Override public boolean operateYMDurationDTDuration(IntegerPointable intp1, LongPointable longp2) throws SystemException, IOException { if (intp1.getInteger() == 0 && longp2.getLong() == 0) { return true; } return false; }
@Override public boolean operateDTDurationYMDuration(LongPointable longp1, IntegerPointable intp2) throws SystemException, IOException { if (longp1.getLong() == 0 && intp2.getInteger() == 0) { return true; } return false; }
@Override public void operateYMDurationInteger(IntegerPointable intp, LongPointable longp, DataOutput dOut) throws SystemException, IOException { if (longp.getLong() == 0) { throw new SystemException(ErrorCode.FOAR0001); } int value = intp.intValue(); value /= longp.intValue(); dOut.write(ValueTag.XS_YEAR_MONTH_DURATION_TAG); dOut.writeInt(value); }
@Override public boolean operateDTDurationDuration(LongPointable longp1, XSDurationPointable durationp2) throws SystemException, IOException { if (durationp2.getYearMonth() == 0 && durationp2.getDayTime() == longp1.getLong()) { return true; } return false; }
@Override public void operateFloatInteger(FloatPointable floatp1, LongPointable longp2, DataOutput dOut) throws SystemException, IOException { if (longp2.getLong() == 0) { throw new SystemException(ErrorCode.FOAR0001); } float value = floatp1.floatValue(); value /= longp2.floatValue(); dOut.write(ValueTag.XS_FLOAT_TAG); dOut.writeFloat(value); }
@Override public void operateDoubleInteger(DoublePointable doublep, LongPointable longp, DataOutput dOut) throws SystemException, IOException { if (longp.getLong() == 0) { throw new SystemException(ErrorCode.FOAR0001); } double value = doublep.doubleValue(); value /= longp.doubleValue(); dOut.write(ValueTag.XS_DOUBLE_TAG); dOut.writeDouble(value); }
@Override public void operateDTDurationInteger(LongPointable longp1, LongPointable longp2, DataOutput dOut) throws SystemException, IOException { if (longp2.getLong() == 0) { throw new SystemException(ErrorCode.FODT0002); } long value = longp1.longValue(); value /= longp2.longValue(); dOut.write(ValueTag.XS_DAY_TIME_DURATION_TAG); dOut.writeLong(value); }
public static long getIntervalEnd(byte[] data, int start) { if (getIntervalTimeType(data, start) == ATypeTag.DATETIME.serialize()) { return LongPointable.getLong(data, getIntervalEndOffset(data, start)); } else { return IntegerPointable.getInteger(data, getIntervalEndOffset(data, start)); } }
@Override public boolean operateIntegerDecimal(LongPointable longp1, XSDecimalPointable decp2) throws SystemException, IOException { abvsInner.reset(); XSDecimalPointable decp1 = (XSDecimalPointable) XSDecimalPointable.FACTORY.createPointable(); decp1.set(abvsInner.getByteArray(), abvsInner.getStartOffset(), XSDecimalPointable.TYPE_TRAITS.getFixedLength()); decp1.setDecimal(longp1.getLong(), (byte) 0); return (decp1.compareTo(decp2) == 0); }
@Override public boolean operateDecimalInteger(XSDecimalPointable decp1, LongPointable longp2) throws SystemException, IOException { abvsInner.reset(); XSDecimalPointable decp2 = (XSDecimalPointable) XSDecimalPointable.FACTORY.createPointable(); decp2.set(abvsInner.getByteArray(), abvsInner.getStartOffset(), XSDecimalPointable.TYPE_TRAITS.getFixedLength()); decp2.setDecimal(longp2.getLong(), (byte) 0); return (decp1.compareTo(decp2) == -1); }
@Override public boolean operateIntegerDecimal(LongPointable longp1, XSDecimalPointable decp2) throws SystemException, IOException { abvsInner.reset(); XSDecimalPointable decp1 = (XSDecimalPointable) XSDecimalPointable.FACTORY.createPointable(); decp1.set(abvsInner.getByteArray(), abvsInner.getStartOffset(), XSDecimalPointable.TYPE_TRAITS.getFixedLength()); decp1.setDecimal(longp1.getLong(), (byte) 0); return (decp1.compareTo(decp2) == -1); }
@Override public void operateDecimalInteger(XSDecimalPointable decp1, LongPointable longp2, DataOutput dOut) throws SystemException, IOException { if (longp2.getLong() == 0) { throw new SystemException(ErrorCode.FOAR0001); } // Convert abvsInner.reset(); decp2.set(abvsInner.getByteArray(), abvsInner.getStartOffset(), XSDecimalPointable.TYPE_TRAITS.getFixedLength()); decp2.setDecimal(longp2.longValue(), (byte) 0); operateDecimalDecimal(decp1, decp2, dOut); }