@@ -19,11 +19,11 @@ export abstract class Value<T> {
1919 }
2020}
2121
22- class Literal < T = any > extends Value < T > {
22+ export class Literal < T = any > extends Value < T > {
2323 constructor ( public v : T ) { super ( ) ; }
2424}
2525
26- class Col < T = any > extends Value < T > {
26+ export class Col < T = any > extends Value < T > {
2727 vector : Vector < T > ;
2828 colidx : number ;
2929
@@ -55,7 +55,7 @@ export abstract class Predicate {
5555 ands ( ) : Predicate [ ] { return [ this ] ; }
5656}
5757
58- abstract class ComparisonPredicate < T = any > extends Predicate {
58+ export abstract class ComparisonPredicate < T = any > extends Predicate {
5959 constructor ( public readonly left : Value < T > , public readonly right : Value < T > ) {
6060 super ( ) ;
6161 }
@@ -105,7 +105,7 @@ class Or extends CombinationPredicate {
105105 }
106106}
107107
108- class Equals extends ComparisonPredicate {
108+ export class Equals extends ComparisonPredicate {
109109 protected _bindLitLit ( _ : Vector < any > [ ] , left : Literal , right : Literal ) : PredicateFunc {
110110 const rtrn : boolean = left . v == right . v ;
111111 return ( ) => rtrn ;
@@ -121,6 +121,9 @@ class Equals extends ComparisonPredicate {
121121 const col_func = col . bind ( cols ) ;
122122 if ( col . vector instanceof DictionaryVector ) {
123123 // Assume that there is only one key with the value `lit.v`
124+ // TODO: add lazily-computed reverse dictionary lookups, associated
125+ // with col.vector.data so that we only have to do this once per
126+ // dictionary
124127 let key = - 1 ;
125128 for ( ; ++ key < col . vector . data . length ; ) {
126129 if ( col . vector . data . get ( key ) === lit . v ) {
@@ -146,7 +149,7 @@ class Equals extends ComparisonPredicate {
146149 }
147150}
148151
149- class LTeq extends ComparisonPredicate {
152+ export class LTeq extends ComparisonPredicate {
150153 protected _bindLitLit ( _ : Vector < any > [ ] , left : Literal , right : Literal ) : PredicateFunc {
151154 const rtrn : boolean = left . v <= right . v ;
152155 return ( ) => rtrn ;
@@ -164,7 +167,7 @@ class LTeq extends ComparisonPredicate {
164167 }
165168}
166169
167- class GTeq extends ComparisonPredicate {
170+ export class GTeq extends ComparisonPredicate {
168171 protected _bindLitLit ( _ : Vector < any > [ ] , left : Literal , right : Literal ) : PredicateFunc {
169172 const rtrn : boolean = left . v >= right . v ;
170173 return ( ) => rtrn ;
@@ -183,4 +186,4 @@ class GTeq extends ComparisonPredicate {
183186}
184187
185188export function lit ( n : number ) : Value < any > { return new Literal ( n ) ; }
186- export function col ( n : string ) : Value < any > { return new Col ( n ) ; }
189+ export function col ( n : string ) : Col < any > { return new Col ( n ) ; }
0 commit comments