public String toJSONString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append("{"); 
        //boolean rowWithNesting = hasNestedTable();
        if ( isHidden() )
            sb.append("\"class\":\"hidden\"," );
        //else if ( rowWithNesting )
        //    sb.append(" class=\"nested\"" );
        sb.append("\"cells\":[");
        // start first cell
        if ( nested )
            sb.append("{\"class\":\"siglumhidden\",");
        else
            sb.append("{\"class\":\"siglumleft\",");
        // write siglum
        sb.append("\"segments\":[");
        String versionsString = Utils.bitSetToString(sigla,groups,versions);
        sb.append("{\"text\":\"");
        sb.append( versionsString );
        sb.append( "\"}]" );
        sb.append("},");    // end first cell
        for ( int i=0;i<cells.size();i++ )
        {
            FragList fl = cells.get(i);
            if ( fl.merged && fl.isBase )
                fl.setID( id++ );
            sb.append( fl.toJSONString() );
            if ( i < cells.size()-1 )
                sb.append(",");
        }
        sb.append("]}");
        return sb.toString();
    }