@Override public Tuple2<FloatValue, LongValue> map(Tuple3<T, LongValue, FloatValue> value) throws Exception { long degree = value.f1.getValue(); long neighborPairs = degree * (degree - 1) / 2; sumOfScores.setValue(value.f2.getValue() * neighborPairs); numberOfNeighborPairs.setValue(neighborPairs); return output; } }
@Override public void putNormalizedKey(T record, MemorySegment target, int offset, int numBytes) { NormalizableKey<?> key = (NormalizableKey<?>) record; key.copyNormalizedKey(target, offset, numBytes); }
public CustomType(int i, long l, String s) { myInt = new IntValue(i); myLong = new LongValue(l); myString = new StringValue(s); }
@Override protected Record getRecord(int index) { return new Record(new IntValue(index), new StringValue(String.valueOf(index))); }
public CrazyNested(String set, String second, long s) { // additional CTor to set all fields to non-null values this(set); something = new LongValue(s); nestLvl1.a = new StringValue(second); }
@Override @SuppressWarnings("unchecked") protected Either<String, Integer>[] getTestData() { return new Either[] { new Either.Left("hello friend"), new Either.Left("hello friend"), new Either.Right(37), new Either.Left("hello friend"), new Either.Right(1569653), new Either.Left("hello friend") }; } }
@Override public ShortValue[] getValidTestResults() { return new ShortValue[] { new ShortValue((short) 0), new ShortValue((short) 1), new ShortValue((short) 576), new ShortValue((short) -8778), new ShortValue(Short.MAX_VALUE), new ShortValue(Short.MIN_VALUE), new ShortValue((short)1239) }; }
/** * Creates a new record containing only a single field, which is the given value. * * @param value The value for the single field of the record. */ public Record(Value value) { setField(0, value); }
/** * Gets this StringValue as a String. * * @return A String resembling the contents of this StringValue. */ public String getValue() { return toString(); }
@Override public DoubleValue deserialize(DoubleValue reuse, DataInputView source) throws IOException { reuse.read(source); return reuse; }
@Override public int compareToReference(TypeComparator<BooleanValue> referencedComparator) { BooleanValue otherRef = ((BooleanValueComparator) referencedComparator).reference; int comp = otherRef.compareTo(reference); return ascendingComparison ? comp : -comp; }
@Override public int compare(CharValue first, CharValue second) { int comp = first.compareTo(second); return ascendingComparison ? comp : -comp; }
@Override public int compare(FloatValue first, FloatValue second) { int comp = first.compareTo(second); return ascendingComparison ? comp : -comp; }
@Override public int compareToReference(TypeComparator<ShortValue> referencedComparator) { ShortValue otherRef = ((ShortValueComparator) referencedComparator).reference; int comp = otherRef.compareTo(reference); return ascendingComparison ? comp : -comp; }
/** * Finds any occurrence of the <code>str</code> character sequence in this StringValue. * * @return The position of the first occurrence of the search string in the string value, or <code>-1</code>, if * the character sequence was not found. */ public int find(CharSequence str) { return find(str, 0); }
@Override public Appendable append(char c) { grow(this.len + 1); this.value[this.len++] = c; return this; }