Skip to content

Commit

Permalink
run spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
kosak committed Jan 6, 2022
1 parent 9f0c2de commit 5249c95
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
26 changes: 13 additions & 13 deletions extensions/csv/src/main/java/io/deephaven/csv/parsers/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@
import java.util.Arrays;

/**
* The Parser interface to the CsvReader. This is implemented by all the built-in parsers
* {@link IntParser}, {@link DoubleParser}, etc, as well as user-defined custom parsers.
* The Parser interface to the CsvReader. This is implemented by all the built-in parsers {@link IntParser},
* {@link DoubleParser}, etc, as well as user-defined custom parsers.
*
* @param <TARRAY>
*/
public interface Parser<TARRAY> {
int CHUNK_SIZE = 65536 * 4;

/**
* Make a context object for the parser. Sample implementation:
* <code><pre>
* Make a context object for the parser. Sample implementation: <code><pre>
* final MySink sink = new MySink();
* return new ParserContext<>(sink, null, new MyType[chunkSize]);
* </pre></code>
*
* <p>Note that parsers other than {Byte,Short,Int,Long}Parser can leave the
* source field null, as in the above example.
* @param gctx The GlobalContext. Built-in parsers use this to access the SinkFactory so that
* they can make a Sink of the right type. Custom parsers will probably not need
* this.
* <p>
* Note that parsers other than {Byte,Short,Int,Long}Parser can leave the source field null, as in the above
* example.
*
* @param gctx The GlobalContext. Built-in parsers use this to access the SinkFactory so that they can make a Sink
* of the right type. Custom parsers will probably not need this.
* @param chunkSize The size of the chunk to create.
* @return The ParserContext.
*/
Expand Down Expand Up @@ -57,10 +58,9 @@ public interface Parser<TARRAY> {
* @param begin The start of the range (inclusive) to write values to.
* @param end The end of the range (exclusive) to write values to. This can also be a very large value like
* Long.MAX_VALUE if the caller does not know how many values there are.
* @param appending Whether the parser is being called in a mode where it is appending to the
* end of the {@link Sink} or replacing previously-written pad values in the
* {@link Sink}. This value is simply passed on to {@link Sink#write}
* which may use it as a hint to slightly simplify its logic.
* @param appending Whether the parser is being called in a mode where it is appending to the end of the
* {@link Sink} or replacing previously-written pad values in the {@link Sink}. This value is simply passed
* on to {@link Sink#write} which may use it as a hint to slightly simplify its logic.
* @return The end range (exclusive) of the values parsed. Returns {@code begin} if no values were parsed.
*/
long tryParse(GlobalContext gctx, ParserContext<TARRAY> pctx, IteratorHolder ih,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public class Parsers {
STRING);

/**
* The above plus BYTE. The TIMESTAMP_* parsers are never included by default, because they look like
* ints/longs.
* The above plus BYTE. The TIMESTAMP_* parsers are never included by default, because they look like ints/longs.
*/
public static final List<Parser<?>> COMPLETE = List.of(
BOOLEAN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ private String[] canonicalizeHeaders(final String[] headers) throws CsvReaderExc

/**
* Try to read one row from the input. Returns false if the input ends before one row has been read.
*
* @return The first row as a byte[][] or null if the input was exhausted.
*/
private static byte[][] tryReadOneRow(final CellGrabber grabber) throws CsvReaderException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
import java.util.function.IntConsumer;

/**
* The job of this class is to take a column of cell text, as prepared by {@link ParseInputToDenseStorage},
* do type inference if appropriate, and parse the text into typed data.
* The job of this class is to take a column of cell text, as prepared by {@link ParseInputToDenseStorage}, do type
* inference if appropriate, and parse the text into typed data.
*/
public final class ParseDenseStorageToColumn {
/**
* @param dsr A reader for the input.
* @param dsrAlt A second reader for the same input (used to perform the second pass over the data, if type
* inference deems a second pass to be necessary).
* inference deems a second pass to be necessary).
* @param parsers The set of parsers to try. If null, then {@link Parsers#DEFAULT} will be used.
* @param nullValueLiteral If a cell text is equal to this value, it will be interpreted as the null value.
* Typically set to the empty string.
Expand Down
12 changes: 8 additions & 4 deletions extensions/csv/src/main/java/io/deephaven/csv/util/Renderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@


/**
* Utility class for rendering Iterables as a string. The methods can intersperse a comma (or other separator),
* and can take a custom function to render the item as a string.
* Utility class for rendering Iterables as a string. The methods can intersperse a comma (or other separator), and can
* take a custom function to render the item as a string.
*/
public class Renderer {
/**
* Render the items in {@code items} using the separator ", " and renderer {@link Object#toString}.
*
* @param items The items.
* @return The items rendered as a {@link String}, separated by {@code separator}.
*/
Expand All @@ -19,6 +20,7 @@ public static <T> String renderList(Iterable<T> items) {

/**
* Render the items in {@code items} using a custom separator and renderer {@link Object#toString}.
*
* @param items The items.
* @param separator The separator.
* @return The items rendered as a {@link String}, separated by {@code separator}.
Expand All @@ -29,6 +31,7 @@ public static <T> String renderList(Iterable<T> items, String separator) {

/**
* Render the items in {@code items} using a custom separator and custom renderer.
*
* @param items The items.
* @param separator The separator.
* @param renderer The renderer.
Expand All @@ -39,8 +42,9 @@ public static <T> String renderList(Iterable<T> items, final String separator, F
}

/**
* Render the items in {@code items} to the {@link StringBuilder} sb, using the separator {@code separator},
* and the custom rendering function {@code renderer}.
* Render the items in {@code items} to the {@link StringBuilder} sb, using the separator {@code separator}, and the
* custom rendering function {@code renderer}.
*
* @param sb The destination where the text is written to.
* @param items The items to render.
* @param separator THe separator to use.
Expand Down

0 comments on commit 5249c95

Please sign in to comment.