Package org.openrefine.model.changes
Class IndexedData<T>
- java.lang.Object
-
- org.openrefine.model.changes.IndexedData<T>
-
- All Implemented Interfaces:
Serializable
public class IndexedData<T> extends Object implements Serializable
Helper class to represent an item in the map from row ids to change values in the context of aChangeData
object. The row id is always provided. The associated data may be null. This happens when the underlying change data computing process returned null or that the row/record with this id was simply excluded from the computation (via facets) in the first place. Additionally, the indexed data can be marked as "being computed", meaning that it is not available yet but may become non-null later.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IndexedData(long rowId)
IndexedData(long rowId, T data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> CloseableIterator<IndexedData<T>>
completeIterator(CloseableIterator<IndexedData<T>> originalIterator)
Completes an iterator over a set of indexed data, by appending an infinite stream of pending indexed data objects after the original stream ends.boolean
equals(Object other)
T
getData()
long
getId()
int
hashCode()
boolean
isPending()
static <T> IndexedData<T>
read(String line, ChangeDataSerializer<T> serializer)
String
toString()
void
write(OutputStreamWriter os, ChangeDataSerializer<T> serializer)
String
writeAsString(ChangeDataSerializer<T> serializer)
-
-
-
Constructor Detail
-
IndexedData
public IndexedData(long rowId, T data)
-
IndexedData
public IndexedData(long rowId)
-
-
Method Detail
-
getId
public long getId()
-
getData
public T getData()
-
isPending
public boolean isPending()
-
write
public void write(OutputStreamWriter os, ChangeDataSerializer<T> serializer) throws IOException
- Throws:
IOException
-
writeAsString
public String writeAsString(ChangeDataSerializer<T> serializer) throws IOException
- Throws:
IOException
-
read
public static <T> IndexedData<T> read(String line, ChangeDataSerializer<T> serializer) throws IOException
- Throws:
IOException
-
completeIterator
public static <T> CloseableIterator<IndexedData<T>> completeIterator(CloseableIterator<IndexedData<T>> originalIterator)
Completes an iterator over a set of indexed data, by appending an infinite stream of pending indexed data objects after the original stream ends. Those pending indexed data instances have indices which follow the last index seen in the original stream.
-
-