/*
 * SDK Pullenti Lingvo, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software.
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C#.NET project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const StringBuilder = require("./../../unisharp/StringBuilder");

class NGItem {
    
    constructor() {
        this.source = null;
        this.order = 0;
        this.commaBefore = false;
        this.commaAfter = false;
        this.andBefore = false;
        this.andAfter = false;
        this.orBefore = false;
        this.orAfter = false;
        this.links = new Array();
        this.ind = 0;
    }
    
    get resObject() {
        return (this.source === null ? null : this.source.result);
    }
    
    toString() {
        let tmp = new StringBuilder();
        if (this.commaBefore) 
            tmp.append("[,] ");
        else if (this.orBefore) 
            tmp.append("[|] ");
        else if (this.andBefore) 
            tmp.append("[&] ");
        tmp.append(this.source.toString());
        if (this.commaAfter) 
            tmp.append(" [,]");
        else if (this.orAfter) 
            tmp.append(" [|]");
        else if (this.andAfter) 
            tmp.append(" [&]");
        return tmp.toString();
    }
    
    prepare() {
        this.links.splice(0, this.links.length);
    }
    
    static _new3813(_arg1) {
        let res = new NGItem();
        res.source = _arg1;
        return res;
    }
    
    static _new3814(_arg1, _arg2, _arg3, _arg4) {
        let res = new NGItem();
        res.source = _arg1;
        res.commaBefore = _arg2;
        res.andBefore = _arg3;
        res.orBefore = _arg4;
        return res;
    }
    
    static _new3819(_arg1, _arg2) {
        let res = new NGItem();
        res.source = _arg1;
        res.order = _arg2;
        return res;
    }
}


module.exports = NGItem