@Override public void putNormalizedKey(Date record, MemorySegment target, int offset, int numBytes) { putNormalizedKeyDate(record, target, offset, numBytes); }
@Override public void putNormalizedKey(java.util.Date record, MemorySegment target, int offset, int numBytes) { // put Date key DateComparator.putNormalizedKeyDate(record, target, offset, numBytes > 8 ? 8 : numBytes); numBytes -= 8; offset += 8; if (numBytes <= 0) { // nothing to do } // put nanos else if (numBytes < 4) { final int nanos = ((Timestamp) record).getNanos(); for (int i = 0; numBytes > 0; numBytes--, i++) { target.put(offset + i, (byte) (nanos >>> ((3-i)<<3))); } } // put nanos with padding else { final int nanos = ((Timestamp) record).getNanos(); target.putIntBigEndian(offset, nanos); for (int i = 4; i < numBytes; i++) { target.put(offset + i, (byte) 0); } } }
public static void putTimeNormalizedKey(Time value, MemorySegment target, int offset, int numBytes) { DateComparator.putNormalizedKeyDate(value, target, offset, numBytes); }
public static void putDateNormalizedKey(Date value, MemorySegment target, int offset, int numBytes) { DateComparator.putNormalizedKeyDate(value, target, offset, numBytes); }
@Override public void putNormalizedKey(Date record, MemorySegment target, int offset, int numBytes) { putNormalizedKeyDate(record, target, offset, numBytes); }
@Override public void putNormalizedKey(Date record, MemorySegment target, int offset, int numBytes) { putNormalizedKeyDate(record, target, offset, numBytes); }
@Override public void putNormalizedKey(java.util.Date record, MemorySegment target, int offset, int numBytes) { // put Date key DateComparator.putNormalizedKeyDate(record, target, offset, numBytes > 8 ? 8 : numBytes); numBytes -= 8; offset += 8; if (numBytes <= 0) { // nothing to do } // put nanos else if (numBytes < 4) { final int nanos = ((Timestamp) record).getNanos(); for (int i = 0; numBytes > 0; numBytes--, i++) { target.put(offset + i, (byte) (nanos >>> ((3-i)<<3))); } } // put nanos with padding else { final int nanos = ((Timestamp) record).getNanos(); target.putIntBigEndian(offset, nanos); for (int i = 4; i < numBytes; i++) { target.put(offset + i, (byte) 0); } } }
@Override public void putNormalizedKey(java.util.Date record, MemorySegment target, int offset, int numBytes) { // put Date key DateComparator.putNormalizedKeyDate(record, target, offset, numBytes > 8 ? 8 : numBytes); numBytes -= 8; offset += 8; if (numBytes <= 0) { // nothing to do } // put nanos else if (numBytes < 4) { final int nanos = ((Timestamp) record).getNanos(); for (int i = 0; numBytes > 0; numBytes--, i++) { target.put(offset + i, (byte) (nanos >>> ((3-i)<<3))); } } // put nanos with padding else { final int nanos = ((Timestamp) record).getNanos(); target.putIntBigEndian(offset, nanos); for (int i = 4; i < numBytes; i++) { target.put(offset + i, (byte) 0); } } }
public static void putTimestampNormalizedKey(Timestamp value, MemorySegment target, int offset, int numBytes) { // put Date key DateComparator.putNormalizedKeyDate(value, target, offset, numBytes > 8 ? 8 : numBytes); numBytes -= 8; offset += 8; if (numBytes <= 0) { // nothing to do } // put nanos else if (numBytes < 4) { final int nanos = value.getNanos(); for (int i = 0; numBytes > 0; numBytes--, i++) { target.put(offset + i, (byte) (nanos >>> ((3 - i) << 3))); } } // put nanos with padding else { final int nanos = value.getNanos(); target.putIntBigEndian(offset, nanos); for (int i = 4; i < numBytes; i++) { target.put(offset + i, (byte) 0); } } }