-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stopping this work for now - doesn't make measurable difference on la…
…rge file performance.
- Loading branch information
Showing
4 changed files
with
238 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,38 @@ | ||
package tech.v3.dataset; | ||
|
||
import ham_fisted.Casts; | ||
|
||
|
||
public interface PParser { | ||
public void addValue(long idx, Object value); | ||
public default void addDouble(long idx, double value) { | ||
if(Double.isNaN(value)) | ||
addMissing(idx); | ||
else | ||
addValue(idx, value); | ||
} | ||
public default void addLong(long idx, long value) { | ||
addValue(idx, value); | ||
} | ||
public default void addMissing(long idx) { | ||
addValue(idx, null); | ||
} | ||
public Object finalize(long rowcount); | ||
|
||
public interface DoubleParser extends PParser { | ||
public default void addValue(long idx, Object value) { | ||
addDouble(idx, Casts.doubleCast(value)); | ||
} | ||
public default void addLong(long idx, long value) { | ||
addDouble(idx, (double)value); | ||
} | ||
} | ||
public interface LongParser extends PParser { | ||
public default void addValue(long idx, Object value) { | ||
addLong(idx, Casts.longCast(value)); | ||
} | ||
public default void addDouble(long idx, Object value) { | ||
addLong(idx, Casts.longCast(value)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.