private Serializer<?> getSerializer(int i, String c) { Serializer<?> s = serializerForPosition(i); if (s != null) { return s; } return serializerForComparator(c); }
@SuppressWarnings("unchecked") @Override public void add(int index, Object element) { serialized = null; if (element instanceof Component) { components.add(index, (Component<?>) element); return; } element = mapIfNumber(element); Serializer s = serializerForPosition(index); if (s == null) { s = SerializerTypeInferer.getSerializer(element); } String c = comparatorForPosition(index); if (c == null) { c = comparatorForSerializer(s); } components.add(index, new Component(element, null, s, c, ComponentEquality.EQUAL)); }
@SuppressWarnings("unchecked") @Override public Object set(int index, Object element) { serialized = null; if (element instanceof Component) { Component prev = components.set(index, (Component<?>) element); if (prev != null) { return prev.getValue(); } return null; } element = mapIfNumber(element); Serializer s = serializerForPosition(index); if (s == null) { s = SerializerTypeInferer.getSerializer(element); } String c = comparatorForPosition(index); if (c == null) { c = comparatorForSerializer(s); } Component prev = components.set(index, new Component(element, null, s, c, ComponentEquality.EQUAL)); if (prev != null) { return prev.getValue(); } return null; }
Serializer<?> s = serializerForPosition(i); ByteBuffer cb = c.getBytes(s); if (cb == null) {