-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initializes PQLValue and adds functionality to evaluator
- Loading branch information
1 parent
607c4c0
commit d25de2d
Showing
81 changed files
with
2,437 additions
and
341 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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
import java.util.Collections; | ||
import java.util.Iterator; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class BagValue implements PQLValue { | ||
|
||
@NotNull | ||
final Iterable<PQLValue> _value; | ||
|
||
BagValue(@NotNull Iterable<PQLValue> value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public Iterator<PQLValue> getBagValues() { | ||
return _value.iterator(); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.BAG; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
partiql-eval/src/main/java/org/partiql/eval/BinaryValue.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class BinaryValue implements PQLValue { | ||
|
||
@NotNull | ||
final byte[] _value; | ||
|
||
BinaryValue(@NotNull byte[] value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public byte[] getBinaryValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.BINARY; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
partiql-eval/src/main/java/org/partiql/eval/BlobValue.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class BlobValue implements PQLValue { | ||
|
||
@NotNull | ||
final byte[] _value; | ||
|
||
BlobValue(@NotNull byte[] value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public byte[] getBlobValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.BLOB; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
partiql-eval/src/main/java/org/partiql/eval/BoolValue.java
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class BoolValue implements PQLValue { | ||
|
||
final boolean _value; | ||
|
||
BoolValue(boolean value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean getBoolValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.BOOL; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
partiql-eval/src/main/java/org/partiql/eval/ByteValue.java
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class ByteValue implements PQLValue { | ||
|
||
final byte _value; | ||
|
||
ByteValue(byte value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public byte getByteValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.BYTE; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
partiql-eval/src/main/java/org/partiql/eval/CharValue.java
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
import java.math.BigInteger; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class CharValue implements PQLValue { | ||
|
||
@NotNull | ||
final String _value; | ||
|
||
CharValue(@NotNull String value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public String getCharValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.CHAR; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
partiql-eval/src/main/java/org/partiql/eval/ClobValue.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class ClobValue implements PQLValue { | ||
|
||
@NotNull | ||
final byte[] _value; | ||
|
||
ClobValue(@NotNull byte[] value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public byte[] getClobValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.CLOB; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
partiql-eval/src/main/java/org/partiql/eval/DateValue.java
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
import org.partiql.value.datetime.Date; | ||
import org.partiql.value.datetime.Time; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class DateValue implements PQLValue { | ||
|
||
@NotNull | ||
final Date _value; | ||
|
||
DateValue(@NotNull Date value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public Date getDateValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.DATE; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
partiql-eval/src/main/java/org/partiql/eval/DecimalArbitraryValue.java
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.partiql.eval; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.partiql.value.PartiQLValueType; | ||
|
||
import java.math.BigDecimal; | ||
|
||
/** | ||
* This shall always be package-private (internal). | ||
*/ | ||
class DecimalArbitraryValue implements PQLValue { | ||
|
||
@NotNull | ||
final BigDecimal _value; | ||
|
||
DecimalArbitraryValue(@NotNull BigDecimal value) { | ||
_value = value; | ||
} | ||
|
||
@Override | ||
public boolean isNull() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public BigDecimal getDecimalArbitraryValue() { | ||
return _value; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PartiQLValueType getType() { | ||
return PartiQLValueType.DECIMAL_ARBITRARY; | ||
} | ||
} |
Oops, something went wrong.