学習データセットに対象点を追加し、学習データセットの構造を更新する。<br>
データ保持数が最大値に達していた場合は学習データセットが保持しているもっとも古い点の削除を行い、削除したデータのIdを返す。

@param max データ保持数最大値
@param addedPoint 対象点
@param dataSet 学習データセット
@return 削除したデータのId。削除しなかった場合はnull
7761
public static String addPointToDataSet(int max, LofPoint addedPoint, LofDataSet dataSet)
    {
        // データ数が最大に達している場合には古い方からデータの削除を行う
        boolean dateDelete = false;
        if (max <= dataSet.getDataIdList().size())
        {
            dateDelete = true;
        }

        // 削除フラグがONの場合は古いデータから削除を行う。
        String deleteId = null;
        if (dateDelete)
        {
            deleteId = dataSet.getDataIdList().get(0);
            dataSet.deleteData(deleteId);
        }

        dataSet.addData(addedPoint);

        return deleteId;
    }
1200594
protected double calculateLofWithUpdate(LofPoint recievedPoint, LofDataSet dataSet)
    {
        double result = 0.0d;

        if (this.hasIntermediate)
        {
            result = LofCalculator.calculateLofWithUpdate(this.kn, this.maxDataCount,
                    recievedPoint, dataSet);
        }
        else
        {
            LofCalculator.addPointToDataSet(this.maxDataCount, recievedPoint, dataSet);
            result = LofCalculator.calculateLofNoIntermediate(this.kn, recievedPoint, dataSet);
        }

        return result;
    }
1119232
@Deprecated
    public static JavaRDD<LabeledPoint> fromDataSet(JavaSparkContext sc, JavaRDD<DataSet> data) {

        return data.map(new Function<DataSet, LabeledPoint>() {
            @Override
            public LabeledPoint call(DataSet pt) {
                return toLabeledPoint(pt);
            }
        });
    }
1361400
public void addDataId(Object dataId) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  if (dataId != null && !dataId.equals("")) {
		  dataIds.add(dataId);
	  }
   }
1276206
public static InsertAllRequest of(String datasetId, String tableId, Iterable<RowToInsert> rows) {
    return newBuilder(datasetId, tableId, rows).build();
  }
199055
public DataSetInfo create(int dataSet) throws InvalidDataSetException {
		DataSetInfo info = dataSets.get(createKey(dataSet));
		if (info == null) {
			int recordNumber = (dataSet >> 8) & 0xFF;
			int dataSetNumber = dataSet & 0xFF;
			throw new UnsupportedDataSetException(recordNumber + ":" + dataSetNumber);
			// info = super.create(dataSet);
		}
		return info;
	}
79714
public void setDatapoints(java.util.Collection<Datapoint> datapoints) {
        if (datapoints == null) {
            this.datapoints = null;
            return;
        }

        this.datapoints = new com.amazonaws.internal.SdkInternalList<Datapoint>(datapoints);
    }
381657
public void addDataPoint(final double DATA) {
        for (DataPoint dataPoint : DATA_LIST) {
            if (System.currentTimeMillis() - dataPoint.getTimeStamp() > timeFrame) {
                trashList.add(dataPoint);
            }
        }

        for (DataPoint dataPoint : trashList) {
            DATA_LIST.remove(dataPoint);
        }
        trashList.clear();
        DATA_LIST.add(new DataPoint(System.currentTimeMillis(), DATA));
        init(INNER_BOUNDS.width, INNER_BOUNDS.height);
        repaint(INNER_BOUNDS);
    }
1267046
@SuppressWarnings("deprecation")
    public static <T> DataSet newDataSet(Collection<String> columnNames, Collection<T> rowList) {
        if (N.isNullOrEmpty(columnNames) && N.isNullOrEmpty(rowList)) {
            // throw new IllegalArgumentException("Column name list and row list can not be both null or empty");
            return new RowDataSet(new ArrayList<String>(0), new ArrayList<List<Object>>(0));
        } else if (N.isNullOrEmpty(rowList)) {
            return new RowDataSet(new ArrayList<String>(columnNames), new ArrayList<List<Object>>(0));
        }

        final int rowSize = rowList.size();

        if (N.isNullOrEmpty(columnNames)) {
            final Set<String> columnNameSet = new LinkedHashSet<>();
            Set<Class<?>> clsSet = null;
            Map<Class<?>, Set<String>> clsSignedPropNameSetMap = new HashMap<>();

            Class<?> cls = null;
            Type<?> type = null;

            for (Object e : rowList) {
                if (e == null) {
                    continue;
                }

                cls = e.getClass();
                type = N.typeOf(cls);

                if (type.isMap()) {
                    columnNameSet.addAll(((Map<String, Object>) e).keySet());
                } else if (type.isEntity()) {
                    if (e instanceof DirtyMarker) {
                        Set<String> clsSignedPropNameSet = clsSignedPropNameSetMap.get(cls);

                        if (clsSignedPropNameSet == null) {
                            clsSignedPropNameSet = new HashSet<>();
                            clsSignedPropNameSetMap.put(cls, clsSignedPropNameSet);
                        }

                        Method method = null;

                        for (String signedPropName : ((DirtyMarker) e).signedPropNames()) {
                            if (clsSignedPropNameSet.add(signedPropName) == false) {
                                continue;
                            }

                            method = ClassUtil.getPropGetMethod(cls, signedPropName);

                            if (method != null) {
                                columnNameSet.add(ClassUtil.getPropNameByMethod(method));
                            }
                        }
                    } else {
                        if (clsSet == null) {
                            clsSet = new HashSet<>();
                        }

                        if (clsSet.contains(cls)) {
                            continue;
                        }

                        columnNameSet.addAll(ClassUtil.checkPropGetMethodList(cls).keySet());
                        clsSet.add(cls);
                    }
                } else {
                    throw new IllegalArgumentException("'columnNameList' is required if the sepcified row type is not Entity or Map");
                }
            }

            // re-order column.
            for (Map.Entry<Class<?>, Set<String>> entry : clsSignedPropNameSetMap.entrySet()) {
                final List<String> intersecion = N.intersection(ClassUtil.getPropGetMethodList(entry.getKey()).keySet(), columnNameSet);
                columnNameSet.removeAll(intersecion);
                columnNameSet.addAll(intersecion);
            }

            columnNames = new ArrayList<>(columnNameSet);

            if (N.isNullOrEmpty(columnNames)) {
                throw new IllegalArgumentException("Column name list can not be obtained from row list because it's empty or null");
            }
        }

        final int columnCount = columnNames.size();
        final List<String> columnNameList = new ArrayList<>(columnNames);
        final List<List<Object>> columnList = new ArrayList<>(columnCount);
        for (int i = 0; i < columnCount; i++) {
            columnList.add(new ArrayList<>(rowSize));
        }

        Type<?> type = null;
        for (Object e : rowList) {
            if (e == null) {
                for (int i = 0; i < columnCount; i++) {
                    columnList.get(i).add(null);
                }

                continue;
            }

            type = N.typeOf(e.getClass());

            if (type.isMap()) {
                Map<String, Object> props = (Map<String, Object>) e;

                for (int i = 0; i < columnCount; i++) {
                    columnList.get(i).add(props.get(columnNameList.get(i)));
                }
            } else if (type.isEntity()) {
                Class<?> cls = e.getClass();

                Method method = null;
                for (int i = 0; i < columnCount; i++) {
                    method = ClassUtil.getPropGetMethod(cls, columnNameList.get(i));

                    if (method == null) {
                        columnList.get(i).add(null);
                    } else {
                        columnList.get(i).add(ClassUtil.getPropValue(e, method));
                    }
                }
            } else if (type.isArray()) {
                if (type.isPrimitiveArray()) {
                    for (int i = 0; i < columnCount; i++) {
                        columnList.get(i).add(Array.get(e, i));
                    }
                } else {
                    Object[] array = (Object[]) e;

                    for (int i = 0; i < columnCount; i++) {
                        columnList.get(i).add(array[i]);
                    }
                }
            } else if (type.isCollection()) {
                final Iterator<Object> it = ((Collection<Object>) e).iterator();

                for (int i = 0; i < columnCount; i++) {
                    columnList.get(i).add(it.next());
                }
            } else {
                throw new IllegalArgumentException(
                        "Unsupported row type: " + ClassUtil.getCanonicalClassName(e.getClass()) + ". Only array, collection, map and entity are supported");
            }
        }

        return new RowDataSet(columnNameList, columnList);
    }
63416
public Iterator<DataPoint> getDataPointIterator()
    {
        Iterator<DataPoint> iteData = new Iterator<DataPoint>() 
        {
            int cur = 0;
            int to = size();

            @Override
            public boolean hasNext()
            {
                return cur < to;
            }

            @Override
            public DataPoint next()
            {
                return getDataPoint(cur++);
            }

            @Override
            public void remove()
            {
                throw new UnsupportedOperationException("This operation is not supported for DataSet");
            }
        };
        
        return iteData;
    }
595358
public void setDataList(LinkedList<DataPoint> dataList) {
        DATA_LIST.clear();
        DATA_LIST.addAll(dataList);
        repaint(INNER_BOUNDS);
    }
36845
public Dataset getDataset(String datasetName) {
    // [START ]
    Dataset dataset = bigquery.getDataset(datasetName);
    // [END ]
    return dataset;
  }
312423
public void add(final ExpressionDataPoint dps) {
    metric_uids.addAll(dps.metric_uids);
    
    // TODO - tags intersection
    
    aggregated_tags.addAll(dps.aggregated_tags);
    
    tsuids.addAll(dps.tsuids);
    // TODO - this ain't right. We need to number of dps emitted from HERE. For
    // now we'll just take the first dps size. If it's downsampled then this
    // will be accurate.
    //size += dps.size();
    raw_size += dps.raw_size;
  }
36100
public DataPoint set(DataPoint another) {
        if (type == Type.NONE) {
            _cloneFrom(another);
        } else {
            if (another.type != Type.NONE) {
                set(another.value());
            }
        }

        return this;
    }
137208
public static LofDataSet mergeDataSet(LofDataSet baseDataSet, LofDataSet targetDataSet, int max)
    {
        Collection<LofPoint> basePointList = baseDataSet.getDataMap().values();
        Collection<LofPoint> targetPointList = targetDataSet.getDataMap().values();

        // LOFの対象点を時刻でソートしたリストを生成する。
        List<LofPoint> mergedList = new ArrayList<>();
        mergedList.addAll(basePointList);
        mergedList.addAll(targetPointList);
        Collections.sort(mergedList, new LofPointComparator());

        // ソート後、新しい方から扱うため順番を逆にする。
        Collections.reverse(mergedList);

        // 新しいデータから順にマージ後のモデルに反映する。
        // 但し、お互いに非同期でマージが行われるため同様のIDを持つデータが複数存在するケースがある。
        // そのため、IDを比較してそれまでに取得していないデータの追加のみを行う。
        Set<String> registeredId = new HashSet<>();
        int addedCount = 0;
        LofDataSet resultDataSet = new LofDataSet();

        for (LofPoint targetPoint : mergedList)
        {
            if (registeredId.contains(targetPoint.getDataId()) == true)
            {
                continue;
            }

            registeredId.add(targetPoint.getDataId());
            resultDataSet.addData(targetPoint);
            addedCount++;

            if (addedCount >= max)
            {
                break;
            }
        }

        return resultDataSet;
    }
1339780
@Deprecated
    public static JavaRDD<DataSet> fromLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data,
                    final long numPossibleLabels) {
        return data.map(new Function<LabeledPoint, DataSet>() {
            @Override
            public DataSet call(LabeledPoint lp) {
                return fromLabeledPoint(lp, numPossibleLabels);
            }
        });
    }
7600
protected void addDataWithoutCalculate(LofPoint recievedPoint, LofDataSet dataSet)
    {
        dataSet.addData(recievedPoint);

        // 中間データを保持する場合はデータ追加時に中間データの生成を行う。
        if (this.hasIntermediate)
        {
            LofCalculator.initDataSet(this.kn, dataSet);
        }
    }