Adds a new datapoint to this set.This method is protected, as not all
datasets will be satisfied by adding just a data point.

@param dp the datapoint to add
@param weight weight of the point to add
974803
protected void base_add(DataPoint dp, double weight)
    {
        datapoints.addDataPoint(dp);
        setWeight(size()-1, weight);
    }
19043
public void maxWeight(Assignment assignment, double weight) {
    setWeight(assignment, Math.max(getWeight(assignment), weight));
  }
980502
public void setDataPoints(java.util.Collection<DataPoint> dataPoints) {
        if (dataPoints == null) {
            this.dataPoints = null;
            return;
        }

        this.dataPoints = new java.util.ArrayList<DataPoint>(dataPoints);
    }
1312274
public void addObject(DataSet dataSet) throws Exception {
    	DataObject[] dataObjects = dataSet.getDataObjectArray();
    	for (int i = 0; i < dataObjects.length; i++) {
			this.addObject(dataObjects[i]);
		}
    }
250598
private void putDataPoint(final int i, final DataPoint dp) {
    timestamps[i] = dp.timestamp();
    if (dp.isInteger()) {
      //LOG.debug("Putting #" + i + " (long) " + dp.longValue()
      //          + " @ time " + dp.timestamp());
      values[i] = dp.longValue();
    } else {
      //LOG.debug("Putting #" + i + " (double) " + dp.doubleValue()
      //          + " @ time " + dp.timestamp());
      values[i] = Double.doubleToRawLongBits(dp.doubleValue());
      timestamps[i] |= FLAG_FLOAT;
    }
  }
1306061
@Override
  public void put(double val, double weight) {
    if(weight <= 0) {
      return;
    }
    if(this.n == 0) {
      n = weight;
      min = max = val;
      sum = val * weight;
      m2 = m3 = m4 = 0;
      return;
    }
    final double nn = weight + this.n;
    final double deltan = val * this.n - this.sum;
    final double inc = deltan * weight;

    // Some factors used below:
    final double delta_nn = deltan / (this.n * nn);
    final double delta_nnw = delta_nn * weight;
    final double delta_nn2 = delta_nn * delta_nn;
    final double delta_nn3 = delta_nn2 * delta_nn;
    final double nb2 = weight * weight;

    final double tmp1 = this.n - weight;
    final double tmp2 = this.n * tmp1 + nb2;
    this.m4 += inc * delta_nn3 * tmp2 + 6. * nb2 * this.m2 * delta_nn2 - 4. * this.m3 * delta_nnw;
    this.m3 += inc * delta_nn2 * tmp1 - 3. * this.m2 * delta_nnw;
    this.m2 += inc * delta_nn;
    this.sum += weight * val;
    this.n = nn;

    min = val < min ? val : min;
    max = val > max ? val : max;
  }
984047
public void add( Color color , Point3D_F64... polygon ) {

		final Poly p = new Poly(polygon.length,color);

		for( int i = 0; i < polygon.length; i++ )
			p.pts[i] = polygon[i].copy();

		synchronized (polygons) {
			polygons.add( p );
		}
	}
491170
public void addDatastream(Datastream datastream, boolean addNewVersion)
            throws ServerException {
        assertNotInvalidated();
        assertNotPendingRemoval();
        // use this call to handle versionable
        m_obj.addDatastreamVersion(datastream, addNewVersion);
    }
369314
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  // WARNING! Don't make a call from methods of the class to not break stack depth!
  public static void addPoint(@Nonnull final String timePointName, @Nonnull final TimeAlertListener listener) {
    final List<TimeData> list = REGISTRY.get();
    list.add(new TimeData(ThreadUtils.stackDepth(), timePointName, -1L, assertNotNull(listener)));
  }
390093
public DataPoint add(DataPoint another) {
        if (type == Type.NONE) {
            _cloneFrom(another);
        } else {
            if (another.type != Type.NONE) {
                add(another.value());
            }
        }

        return this;
    }
1014421
public void setWeight(int i, double w)
    {
        if(i >= size() || i < 0)
            throw new IndexOutOfBoundsException("Dataset has only " + size() + " members, can't access index " + i );
        else if(Double.isNaN(w) || Double.isInfinite(w) || w < 0)
            throw new ArithmeticException("Invalid weight assignment of  " + w);
        
        if(w == 1 && weights == null)
            return;//nothing to do, already handled implicitly
        
        if(weights == null)//need to init?
        {
            weights = new double[size()];
            Arrays.fill(weights, 1.0);
        }
        
        //make sure we have enouh space
        if (weights.length <= i)
            weights = Arrays.copyOfRange(weights, 0, Math.max(weights.length*2, i+1));
        
        weights[i] = w;
    }
916372
def addDataProducts(self, dps):
        
        busy = Purr.BusyIndicator()
        wakeup = False
        # build up list of items to be inserted
        itemlist = []
        for dp in dps:
            item = self.dpitems.get(dp.sourcepath)
            # If item already exists, it needs to be moved to its new position
            # If takeTopLevelItem() returns None, then item was already removed (this shouldn't happen,
            # but let's be defensive), and we make a new one anyway.
            if item and self.takeTopLevelItem(self.indexOfTopLevelItem(item)):
                itemlist.append(item)
            else:
                itemlist.append(self._makeDPItem(None, dp))
            wakeup = wakeup or not (dp.ignored or dp.quiet)
        # if these DPs were added as a result of a drag-and-drop, we need to insert them in FRONT of the dropped-on item
        if self._dropped_on:
            index = self.indexOfTopLevelItem(self._dropped_on)
        # else insert at end (after=None)
        else:
            index = self.topLevelItemCount()
        if itemlist:
            self.insertTopLevelItems(index, itemlist)
            self.emit(SIGNAL("updated"))
        for item in itemlist:
            # ensure combobox widgets are made
            self._itemComboBox(item, self.ColAction)
            self._itemComboBox(item, self.ColRender)
        return wakeup
610002
private void putDataPoint(int i, Entry<Long, Double> datapoint) {
		timestamps[i] = datapoint.getKey();
		values[i] = datapoint.getValue();
	}
562717
public final void addServer(final String server, final int port, int weight) throws IOException {
    if (weight <= 0) {
      throw new IllegalArgumentException("weight<=0");
    }
    this.checkServerPort(server, port);
    this.connect(new InetSocketAddressWrapper(this.newSocketAddress(server, port),
        this.serverOrderCount.incrementAndGet(), weight, null));
  }
739433
@Override
    public synchronized ChannelData updateChannelWeight(String channelName, int newWeight) throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "updateChannelWeight");
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "channelName=" + channelName + ", newWeight=" + newWeight);
        }
        if (null == channelName) {
            throw new InvalidChannelNameException("Input channel name is null");
        }
        if (newWeight < 0) {
            throw new InvalidWeightException("Invalid input weight, " + newWeight);
        }

        // Find the existing channel config
        ChannelDataImpl channelData = (ChannelDataImpl) channelDataMap.get(channelName);
        if (null == channelData) {
            throw new InvalidChannelNameException("Unable to find input channel, " + channelName);
        }

        // Set the new weight in the framework.
        channelData.setDiscriminatorWeight(newWeight);
        // Update each running channel that is using this parent channel data
        // object.
        updateRunningChannels(channelData);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "updateChannelWeight");
        }
        return channelData;
    }
515340
public static final Point add(Point... points)
    {
        AbstractPoint res = new AbstractPoint();
        for (Point pp : points)
        {
            res.x += pp.getX();
            res.y += pp.getY();
        }
        return res;
    }
172234
public void setStartUpWeight(Integer weight) {
        //save previous weight to see if we need to try to remove and add it again to the list
        this.previousWeight = this.startUpWeight;
        
        if (weight != null) {
            if (weight.intValue() >= 0)
                this.startUpWeight = weight;
            else
                this.startUpWeight = DEFAULT_STARTUP;
        } else {
            this.startUpWeight = DEFAULT_STARTUP;
        }
        if (this.context != null)
            this.context.addToStartWeightList(this);
    }