Ejemplo n.º 1
0
 TableSelectBuilder(ITableSource from, List <IWhereClause> whereClauses,
                    List <OrderByField> orderByClauses, ISelectColumns columnSelection = null,
                    IRowSelection rowSelection = null)
     : base(whereClauses, orderByClauses, columnSelection, rowSelection)
 {
     From = from;
 }
Ejemplo n.º 2
0
 UnionSelectBuilder(ISelect innerSelect, string customAlias, ITableAliasGenerator tableAliasGenerator, List <IWhereClause> whereClauses, List <OrderByField> orderByClauses,
                    ISelectColumns columnSelection = null, IRowSelection rowSelection = null)
     : base(whereClauses, orderByClauses, columnSelection, rowSelection)
 {
     this.innerSelect         = innerSelect;
     this.customAlias         = customAlias;
     this.tableAliasGenerator = tableAliasGenerator;
 }
Ejemplo n.º 3
0
        readonly OrderBy orderBy; // Can be null

        public Select(IRowSelection rowSelection, ISelectColumns columns, ISelectSource from, Where where, OrderBy orderBy)
        {
            this.rowSelection = rowSelection;
            this.columns      = columns;
            this.from         = from;
            this.where        = where;
            this.orderBy      = orderBy;
        }
Ejemplo n.º 4
0
 protected SelectBuilderBase(List <IWhereClause> whereClauses, List <OrderByField> orderByClauses,
                             ISelectColumns columnSelection = null,
                             IRowSelection rowSelection     = null)
 {
     WhereClauses         = whereClauses;
     OrderByClauses       = orderByClauses;
     this.RowSelection    = rowSelection;
     this.ColumnSelection = columnSelection;
 }
Ejemplo n.º 5
0
        public FitElement(IRowSelection rowSelection)
        {
            _independentVariables = new IReadableColumnProxy[0];

            _dependentVariables = new IReadableColumnProxy[0];

            _errorEvaluation = new IVarianceScaling[0];

            _rangeOfRows = (IRowSelection)(rowSelection?.Clone()) ?? new AllRows();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnionOfRowSelections"/> class.
        /// </summary>
        /// <param name="rowSelectionsHead">The first row selections (cloned before stored).</param>
        /// <param name="selection">Another selection (cloned before stored).</param>
        /// <param name="rowSelectionTail">The last row selections (cloned before stored).</param>
        public UnionOfRowSelections(IEnumerable <IRowSelection> rowSelectionsHead, IRowSelection selection, IEnumerable <IRowSelection> rowSelectionTail)
        {
            _rowSelections = new List <IRowSelection>(rowSelectionsHead.Select(itemToClone => { var clonedItem = (IRowSelection)itemToClone.Clone(); clonedItem.ParentObject = this; return(clonedItem); }));

            {
                var item = (IRowSelection)selection.Clone();
                item.ParentObject = this;
                _rowSelections.Add(item);
            }

            _rowSelections.AddRange(rowSelectionTail.Select(itemToClone => { var clonedItem = (IRowSelection)itemToClone.Clone(); clonedItem.ParentObject = this; return(clonedItem); }));
        }
Ejemplo n.º 7
0
 protected SelectBuilderBase(TSource from, List <IWhereClause> whereClauses, List <OrderByField> orderByClauses,
                             ISelectColumns columnSelection,
                             IRowSelection rowSelection,
                             bool shouldIgnoreDefaultOrderBy)
 {
     From                            = from;
     WhereClauses                    = whereClauses;
     OrderByClauses                  = orderByClauses;
     this.RowSelection               = rowSelection;
     this.ColumnSelection            = columnSelection;
     this.ShouldIgnoreDefaultOrderBy = shouldIgnoreDefaultOrderBy;
 }
Ejemplo n.º 8
0
        public FitElement(DataTable table, int groupNumber, IRowSelection rowSelection, IReadableColumn xColumn, IReadableColumn yColumn)
        {
            if (null == rowSelection)
            {
                throw new ArgumentNullException(nameof(rowSelection));
            }

            ChildSetMember(ref _dataTable, new DataTableProxy(table));
            _groupNumber = groupNumber;
            ChildCloneToMember(ref _rangeOfRows, rowSelection);

            _independentVariables = new IReadableColumnProxy[1];
            ChildSetMember(ref _independentVariables[0], ReadableColumnProxyBase.FromColumn(xColumn));

            _dependentVariables = new IReadableColumnProxy[1];
            ChildSetMember(ref _dependentVariables[0], ReadableColumnProxyBase.FromColumn(yColumn));

            _errorEvaluation    = new IVarianceScaling[1];
            _errorEvaluation[0] = new ConstantVarianceScaling();
        }
Ejemplo n.º 9
0
		public IRowSelectionCollection WithAdditionalItem(IRowSelection item)
		{
			return new IntersectionOfRowSelections(_rowSelections.Concat(new[] { item }));
		}
Ejemplo n.º 10
0
 public void AddTop(int top)
 {
     RowSelection = new Top(top);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Returns a new instance that resembles this instance, but with the item at index <paramref name="idx"/> set to another item <paramref name="item"/>.
 /// </summary>
 /// <param name="idx">The index to change.</param>
 /// <param name="item">The new item at this index.</param>
 /// <returns>New instance that resembles this instance, but with the item at index <paramref name="idx"/> set to another item <paramref name="item"/>.</returns>
 public IRowSelectionCollection WithChangedItem(int idx, IRowSelection item)
 {
     return(new UnionOfRowSelections(_rowSelections.Take(idx), item, _rowSelections.Skip(idx + 1)));
 }
Ejemplo n.º 12
0
 TableSelectBuilder(ITableSource from, List <IWhereClause> whereClauses,
                    List <OrderByField> orderByClauses, ISelectColumns columnSelection,
                    IRowSelection rowSelection, bool shouldIgnoreDefaultOrderBy)
     : base(from, whereClauses, orderByClauses, columnSelection, rowSelection, shouldIgnoreDefaultOrderBy)
 {
 }
Ejemplo n.º 13
0
		public FitElement(DataTable table, int groupNumber, IRowSelection rowSelection, IReadableColumn xColumn, IReadableColumn yColumn)
		{
			if (null == table)
				throw new ArgumentNullException(nameof(table));
			if (null == rowSelection)
				throw new ArgumentNullException(nameof(rowSelection));

			ChildSetMember(ref _dataTable, new DataTableProxy(table));
			_groupNumber = groupNumber;
			ChildCloneToMember(ref _rangeOfRows, rowSelection);

			_independentVariables = new IReadableColumnProxy[1];
			_independentVariables[0] = ReadableColumnProxyBase.FromColumn(xColumn);

			_dependentVariables = new IReadableColumnProxy[1];
			_dependentVariables[0] = ReadableColumnProxyBase.FromColumn(yColumn);

			_errorEvaluation = new IVarianceScaling[1];
			_errorEvaluation[0] = new ConstantVarianceScaling();
		}
Ejemplo n.º 14
0
		public FitElement()
		{
			_independentVariables = new IReadableColumnProxy[0];

			_dependentVariables = new IReadableColumnProxy[0];

			_errorEvaluation = new IVarianceScaling[0];

			_rangeOfRows = new AllRows();
		}
Ejemplo n.º 15
0
		public IRowSelectionCollection WithChangedItem(int idx, IRowSelection item)
		{
			return new IntersectionOfRowSelections(_rowSelections.Take(idx), item, _rowSelections.Skip(idx + 1));
		}
Ejemplo n.º 16
0
 /// <summary>
 /// Returns a new instance with all row selections from this instance plus one additional item.
 /// </summary>
 /// <param name="item">The item (cloned before stored).</param>
 /// <returns>New instance with all row selections from this instance plus one additional item.</returns>
 public IRowSelectionCollection WithAdditionalItem(IRowSelection item)
 {
     return(new UnionOfRowSelections(_rowSelections.Concat(new[] { item }), _mergeAdjoiningSegments));
 }
Ejemplo n.º 17
0
		public IntersectionOfRowSelections(IEnumerable<IRowSelection> rowSelectionsHead, IRowSelection selection, IEnumerable<IRowSelection> rowSelectionTail)
		{
			_rowSelections = new List<IRowSelection>(rowSelectionsHead.Select(item => { var result = (IRowSelection)item.Clone(); item.ParentObject = this; return item; }));

			{
				var item = (IRowSelection)selection.Clone();
				item.ParentObject = this;
				_rowSelections.Add(item);
			}

			_rowSelections.AddRange(rowSelectionTail.Select(item => { var result = (IRowSelection)item.Clone(); item.ParentObject = this; return item; }));
		}
Ejemplo n.º 18
0
 /// <summary>
 /// Returns a new instance with all row selections from this instance plus one additional item.
 /// </summary>
 /// <param name="item">The item (cloned before stored).</param>
 /// <returns>New instance with all row selections from this instance plus one additional item.</returns>
 public IRowSelectionCollection WithAdditionalItem(IRowSelection item)
 {
     return(new ExcludeUnionOfRowSelections(_rowSelections.Concat(new[] { item })));
 }