@@ -19,11 +19,11 @@ export abstract class Value<T> {
19
19
}
20
20
}
21
21
22
- class Literal < T = any > extends Value < T > {
22
+ export class Literal < T = any > extends Value < T > {
23
23
constructor ( public v : T ) { super ( ) ; }
24
24
}
25
25
26
- class Col < T = any > extends Value < T > {
26
+ export class Col < T = any > extends Value < T > {
27
27
vector : Vector < T > ;
28
28
colidx : number ;
29
29
@@ -55,7 +55,7 @@ export abstract class Predicate {
55
55
ands ( ) : Predicate [ ] { return [ this ] ; }
56
56
}
57
57
58
- abstract class ComparisonPredicate < T = any > extends Predicate {
58
+ export abstract class ComparisonPredicate < T = any > extends Predicate {
59
59
constructor ( public readonly left : Value < T > , public readonly right : Value < T > ) {
60
60
super ( ) ;
61
61
}
@@ -105,7 +105,7 @@ class Or extends CombinationPredicate {
105
105
}
106
106
}
107
107
108
- class Equals extends ComparisonPredicate {
108
+ export class Equals extends ComparisonPredicate {
109
109
protected _bindLitLit ( _ : Vector < any > [ ] , left : Literal , right : Literal ) : PredicateFunc {
110
110
const rtrn : boolean = left . v == right . v ;
111
111
return ( ) => rtrn ;
@@ -121,6 +121,9 @@ class Equals extends ComparisonPredicate {
121
121
const col_func = col . bind ( cols ) ;
122
122
if ( col . vector instanceof DictionaryVector ) {
123
123
// 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
124
127
let key = - 1 ;
125
128
for ( ; ++ key < col . vector . data . length ; ) {
126
129
if ( col . vector . data . get ( key ) === lit . v ) {
@@ -146,7 +149,7 @@ class Equals extends ComparisonPredicate {
146
149
}
147
150
}
148
151
149
- class LTeq extends ComparisonPredicate {
152
+ export class LTeq extends ComparisonPredicate {
150
153
protected _bindLitLit ( _ : Vector < any > [ ] , left : Literal , right : Literal ) : PredicateFunc {
151
154
const rtrn : boolean = left . v <= right . v ;
152
155
return ( ) => rtrn ;
@@ -164,7 +167,7 @@ class LTeq extends ComparisonPredicate {
164
167
}
165
168
}
166
169
167
- class GTeq extends ComparisonPredicate {
170
+ export class GTeq extends ComparisonPredicate {
168
171
protected _bindLitLit ( _ : Vector < any > [ ] , left : Literal , right : Literal ) : PredicateFunc {
169
172
const rtrn : boolean = left . v >= right . v ;
170
173
return ( ) => rtrn ;
@@ -183,4 +186,4 @@ class GTeq extends ComparisonPredicate {
183
186
}
184
187
185
188
export 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