Skip to content

Commit 5c52f23

Browse files
committed
Added some javadocs
1 parent a1b0111 commit 5c52f23

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

src/main/java/org/radarcns/OffsetRangeFile.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
import java.io.Flushable;
1717
import java.io.IOException;
1818

19+
/**
20+
* Accesses a OffsetRange file using the CSV format. On construction, this will create the file if
21+
* not present.
22+
*/
1923
public class OffsetRangeFile implements Flushable, Closeable {
2024
private final CsvMapper mapper;
2125
private final CsvSchema schema;

src/main/java/org/radarcns/OffsetRangeSet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public String toString() {
7373
return "OffsetRangeSet" + ranges;
7474
}
7575

76+
/** Whether the stored offsets is empty. */
7677
public boolean isEmpty() {
7778
return ranges.isEmpty();
7879
}

src/main/java/org/radarcns/util/CsvAvroConverter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
import org.apache.avro.generic.GenericFixed;
1818
import org.apache.avro.generic.GenericRecord;
1919

20+
/**
21+
* Converts deep hierarchical Avro records into flat CSV format. It uses a simple dot syntax in the
22+
* column names to indicate hierarchy. After the first data record is added, all following
23+
* records need to have exactly the same hierarchy (or at least a subset of it.)
24+
*/
2025
public class CsvAvroConverter implements RecordConverter {
2126

2227
public static RecordConverterFactory getFactory() {

src/main/java/org/radarcns/util/FileCache.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ public FileCache(RecordConverterFactory converterFactory, int maxFiles) {
3434
}
3535

3636
/**
37-
* Append a line to given file. This will append a line ending to given data.
38-
* If the file handle and writer are already open in this cache,
37+
* Append a record to given file. If the file handle and writer are already open in this cache,
3938
* those will be used. Otherwise, the file will be opened and the file handle cached.
4039
*
4140
* @param file file to append data to
42-
* @param record data without line ending
41+
* @param record data
4342
* @return true if the cache was used, false if a new file was opened.
4443
* @throws IOException when failing to open a file or writing to it.
4544
*/

src/main/java/org/radarcns/util/JsonAvroConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import org.apache.avro.generic.GenericFixed;
1919
import org.apache.avro.generic.GenericRecord;
2020

21+
/**
22+
* Writes an Avro record to JSON format.
23+
*/
2124
public final class JsonAvroConverter implements RecordConverter {
2225

2326
public static RecordConverterFactory getFactory() {

src/main/java/org/radarcns/util/RecordConverter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.Map;
77
import org.apache.avro.generic.GenericRecord;
88

9+
/** Converts a GenericRecord to Java primitives or writes it to file. */
910
public interface RecordConverter extends Flushable, Closeable {
1011
void writeRecord(GenericRecord record) throws IOException;
1112
Map<String, Object> convertRecord(GenericRecord record);

0 commit comments

Comments
 (0)