@Override public int compare(DataInputView firstSource, DataInputView secondSource) throws IOException { final int fs = firstSource.readBoolean() ? 1 : 0; final int ss = secondSource.readBoolean() ? 1 : 0; int comp = fs - ss; return ascendingComparison ? comp : -comp; }
@Override public int compare(DataInputView firstSource, DataInputView secondSource) throws IOException { final int fs = firstSource.readBoolean() ? 1 : 0; final int ss = secondSource.readBoolean() ? 1 : 0; int comp = fs - ss; return ascendingComparison ? comp : -comp; }
@Override public Boolean deserialize(Boolean reuse, DataInputView source) throws IOException { return Boolean.valueOf(source.readBoolean()); }
@Override public Boolean deserialize(Boolean reuse, DataInputView source) throws IOException { return Boolean.valueOf(source.readBoolean()); }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { target.writeBoolean(source.readBoolean()); } }
@Override public boolean[] deserialize(boolean[] reuse, DataInputView source) throws IOException { final int len = source.readInt(); reuse = new boolean[len]; for (int i = 0; i < len; i++) { reuse[i] = source.readBoolean(); } return reuse; }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { target.writeBoolean(source.readBoolean()); } }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { target.writeBoolean(source.readBoolean()); } }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { source.readBoolean(); target.writeBoolean(false); } }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { source.readBoolean(); target.writeBoolean(false); } }
@Override public boolean[] deserialize(boolean[] reuse, DataInputView source) throws IOException { final int len = source.readInt(); reuse = new boolean[len]; for (int i = 0; i < len; i++) { reuse[i] = source.readBoolean(); } return reuse; }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { target.writeBoolean(source.readBoolean()); } }
@Override public void copy(DataInputView source, DataOutputView target) throws IOException { int len = source.readInt(); target.writeInt(len); for (int i = 0; i < len; i++) { boolean isNonNull = source.readBoolean(); target.writeBoolean(isNonNull); if (isNonNull) { componentSerializer.copy(source, target); } } }
@Override public C[] deserialize(C[] reuse, DataInputView source) throws IOException { int len = source.readInt(); if (reuse.length != len) { reuse = create(len); } for (int i = 0; i < len; i++) { boolean isNonNull = source.readBoolean(); if (isNonNull) { reuse[i] = componentSerializer.deserialize(componentSerializer.createInstance(), source); } else { reuse[i] = null; } } return reuse; }
@Override public VertexWithRankAndDangling readWithKeyDenormalization(VertexWithRankAndDangling reuse, DataInputView source) throws IOException { reuse.setVertexID(source.readLong() + Long.MIN_VALUE); reuse.setRank(source.readDouble()); reuse.setDangling(source.readBoolean()); return reuse; }
@Override public VertexWithRankAndDangling deserialize(VertexWithRankAndDangling target, DataInputView source) throws IOException { target.setVertexID(source.readLong()); target.setRank(source.readDouble()); target.setDangling(source.readBoolean()); return target; }