export enum Direction { Predecessor , Successor } export enum Quantifier { Exists , NotExists } export class Step { public toDeclarativeString ( ) { throw Error ( "Abstract" ) ; } } export class ExistentialCondition extends Step { constructor ( public quantifier , public steps ) { super ( ) ; } public toDeclarativeString ( ) { return ( this . quantifier === Quantifier . Exists ? "E(" : "N(" ) + this . steps . map ( s => s . toDeclarativeString ( ) ) . join ( " " ) + ")" ; } } export class PropertyCondition extends Step { constructor ( public name , public value ) { super ( ) ; } public toDeclarativeString ( ) { return "F." + this . name + "=\"" + this . value + "\"" ; } } export class Join extends Step { constructor ( public direction , public role ) { super ( ) ; } public toDeclarativeString ( ) { return ( this . direction === Direction . Predecessor ? "P." : "S." ) + this . role ; } }