@flexvertex/flexvertex-driver
Version:
The official FlexVertex Node.js driver
76 lines (60 loc) • 2.01 kB
JavaScript
import { JSONParse, JSONStringify } from 'json-with-bigint';
import { FlexResult } from '../schema/FlexResult.js';
import { FlexObject } from '../objects/FlexObject.js';
import { FlexConnection } from '../connections/FlexConnection.js';
/**
* Represents a segment tuple, containing a source object, connection, target object, and direction.
* FlexSegments are typically used within a {@link FlexJourney}.
* @hideconstructor
*/
export class FlexSegment extends FlexResult
{
constructor(schema, segmentObj)
{
super(segmentObj);
if(!(schema === undefined)) this.
if(!(segmentObj === undefined))
{
// console.log("segmentObj = " + JSONStringify(segmentObj));
if(!(segmentObj.Source === undefined))
{
this.
}
else console.log("FlexSegment source is undefined!");
if(!(segmentObj.Connection === undefined))
{
this.
}
if(!(segmentObj.Target === undefined))
{
this.
}
if(!(segmentObj.Direction === undefined))
{
this.
}
}
}
get schema() { return this.
/**
* @property {FlexObject} source - Returns this FlexSegment's source object
*/
get source() { return this.
/**
* @property {FlexConnection} connection - Returns this FlexSegment's connection object
*/
get connection() { return this.
/**
* @property {FlexObject} target - Returns this FlexSegment's target object
*/
get target() { return this.
/**
* @property {string} direction - Returns this FlexSegment's directionality: 'Both', 'From', or 'To'
*/
get direction() { return this.
}