Skip to content

Commit

Permalink
Review responses
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Jul 19, 2023
1 parent 1da2c66 commit 2365372
Show file tree
Hide file tree
Showing 41 changed files with 55 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface ByteVector extends Vector<ByteVector>, Iterable<Byte> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<ByteVector, Byte> type() {
return PrimitiveVectorType.of(ByteVector.class, ByteType.instance());
return PrimitiveVectorType.of(ByteVector.class, ByteType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface CharVector extends Vector<CharVector>, Iterable<Character> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<CharVector, Character> type() {
return PrimitiveVectorType.of(CharVector.class, CharType.instance());
return PrimitiveVectorType.of(CharVector.class, CharType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface DoubleVector extends Vector<DoubleVector>, Iterable<Double> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<DoubleVector, Double> type() {
return PrimitiveVectorType.of(DoubleVector.class, DoubleType.instance());
return PrimitiveVectorType.of(DoubleVector.class, DoubleType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface FloatVector extends Vector<FloatVector>, Iterable<Float> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<FloatVector, Float> type() {
return PrimitiveVectorType.of(FloatVector.class, FloatType.instance());
return PrimitiveVectorType.of(FloatVector.class, FloatType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IntVector extends Vector<IntVector>, Iterable<Integer> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<IntVector, Integer> type() {
return PrimitiveVectorType.of(IntVector.class, IntType.instance());
return PrimitiveVectorType.of(IntVector.class, IntType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface LongVector extends Vector<LongVector>, Iterable<Long> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<LongVector, Long> type() {
return PrimitiveVectorType.of(LongVector.class, LongType.instance());
return PrimitiveVectorType.of(LongVector.class, LongType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface ShortVector extends Vector<ShortVector>, Iterable<Short> {
long serialVersionUID = -1373264425081841175L;

static PrimitiveVectorType<ShortVector, Short> type() {
return PrimitiveVectorType.of(ShortVector.class, ShortType.instance());
return PrimitiveVectorType.of(ShortVector.class, ShortType.of());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void testSubVector() {
@Test
public void testType() {
// region TestType
assertEquals(ObjectVector.type(io.deephaven.qst.type.StringType.instance()).clazz(), ObjectVector.class);
assertEquals(ObjectVector.type(io.deephaven.qst.type.StringType.of()).clazz(), ObjectVector.class);
// endregion TestType
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/BooleanArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final BooleanType componentType() {
return BooleanType.instance();
return BooleanType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/ByteArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final ByteType componentType() {
return ByteType.instance();
return ByteType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/CharArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final CharType componentType() {
return CharType.instance();
return CharType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/DoubleArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final DoubleType componentType() {
return DoubleType.instance();
return DoubleType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/FloatArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final FloatType componentType() {
return FloatType.instance();
return FloatType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/IntArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final IntType componentType() {
return IntType.instance();
return IntType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/LongArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final LongType componentType() {
return LongType.instance();
return LongType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/array/ShortArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final int size() {

@Override
public final ShortType componentType() {
return ShortType.instance();
return ShortType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/BooleanType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class BooleanType extends PrimitiveTypeBase<Boolean> {

public static BooleanType instance() {
public static BooleanType of() {
return ImmutableBooleanType.of();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package io.deephaven.qst.type;

import io.deephaven.annotations.SingletonStyle;
import io.deephaven.qst.type.BoxedType.Visitor;
import org.immutables.value.Value.Immutable;

/**
Expand All @@ -25,7 +24,7 @@ public final Class<Boolean> clazz() {

@Override
public final BooleanType primitiveType() {
return BooleanType.instance();
return BooleanType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/BoxedByteType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Byte> clazz() {

@Override
public final ByteType primitiveType() {
return ByteType.instance();
return ByteType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/BoxedCharType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Character> clazz() {

@Override
public final CharType primitiveType() {
return CharType.instance();
return CharType.of();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Double> clazz() {

@Override
public final DoubleType primitiveType() {
return DoubleType.instance();
return DoubleType.of();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Float> clazz() {

@Override
public final FloatType primitiveType() {
return FloatType.instance();
return FloatType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/BoxedIntType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Integer> clazz() {

@Override
public final IntType primitiveType() {
return IntType.instance();
return IntType.of();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/BoxedLongType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Long> clazz() {

@Override
public final LongType primitiveType() {
return LongType.instance();
return LongType.of();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final Class<Short> clazz() {

@Override
public final ShortType primitiveType() {
return ShortType.instance();
return ShortType.of();
}

@Override
Expand Down
3 changes: 0 additions & 3 deletions qst/src/main/java/io/deephaven/qst/type/BoxedType.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ static Stream<BoxedType<?>> instances() {
<R> R walk(Visitor<R> visitor);

interface Visitor<R> {
static <R> Visitor<R> adapt(PrimitiveType.Visitor<R> visitor) {
return new BoxedTypeVisitorAdapter<>(visitor);
}

R visit(BoxedBooleanType booleanType);

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/ByteType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class ByteType extends PrimitiveTypeBase<Byte> {

public static ByteType instance() {
public static ByteType of() {
return ImmutableByteType.of();
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/CharType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class CharType extends PrimitiveTypeBase<Character> {

public static CharType instance() {
public static CharType of() {
return ImmutableCharType.of();
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/DoubleType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class DoubleType extends PrimitiveTypeBase<Double> {

public static DoubleType instance() {
public static DoubleType of() {
return ImmutableDoubleType.of();
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/FloatType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class FloatType extends PrimitiveTypeBase<Float> {

public static FloatType instance() {
public static FloatType of() {
return ImmutableFloatType.of();
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/InstantType.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@SingletonStyle
public abstract class InstantType extends GenericTypeBase<Instant> {

public static InstantType instance() {
public static InstantType of() {
return ImmutableInstantType.of();
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/IntType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class IntType extends PrimitiveTypeBase<Integer> {

public static IntType instance() {
public static IntType of() {
return ImmutableIntType.of();
}

Expand Down
2 changes: 1 addition & 1 deletion qst/src/main/java/io/deephaven/qst/type/LongType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SingletonStyle
public abstract class LongType extends PrimitiveTypeBase<Long> {

public static LongType instance() {
public static LongType of() {
return ImmutableLongType.of();
}

Expand Down
19 changes: 8 additions & 11 deletions qst/src/main/java/io/deephaven/qst/type/PrimitiveType.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,21 @@ public interface PrimitiveType<T> extends Type<T> {

static Stream<PrimitiveType<?>> instances() {
return Stream.of(
BooleanType.instance(),
ByteType.instance(),
CharType.instance(),
ShortType.instance(),
IntType.instance(),
LongType.instance(),
FloatType.instance(),
DoubleType.instance());
BooleanType.of(),
ByteType.of(),
CharType.of(),
ShortType.of(),
IntType.of(),
LongType.of(),
FloatType.of(),
DoubleType.of());
}

BoxedType<T> boxedType();

<R> R walk(Visitor<R> visitor);

interface Visitor<R> {
static <R> Visitor<R> adapt(BoxedType.Visitor<R> visitor) {
return new PrimitiveTypeVisitorAdapter<>(visitor);
}

R visit(BooleanType booleanType);

Expand Down
Loading

0 comments on commit 2365372

Please sign in to comment.