Skip to content

Commit c1b4da4

Browse files
committed
Adding javadocs
1 parent 9eaeccb commit c1b4da4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedAvg.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@
66
* compatible open source license.
77
*/
88

9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+
933
package org.opensearch.search.aggregations.metrics;
1034

1135
import org.opensearch.core.common.io.stream.StreamInput;
@@ -14,15 +38,29 @@
1438

1539
import java.io.IOException;
1640

41+
/**
42+
* Represents a scripted average calculation containing a sum and count.
43+
*
44+
* @opensearch.internal
45+
*/
1746
public class ScriptedAvg implements Writeable {
1847
private double sum;
1948
private long count;
2049

50+
/**
51+
* Constructor for ScriptedAvg
52+
*
53+
* @param sum The sum of values
54+
* @param count The count of values
55+
*/
2156
public ScriptedAvg(double sum, long count) {
2257
this.sum = sum;
2358
this.count = count;
2459
}
2560

61+
/**
62+
* Read from a stream.
63+
*/
2664
public ScriptedAvg(StreamInput in) throws IOException {
2765
this.sum = in.readDouble();
2866
this.count = in.readLong();

0 commit comments

Comments
 (0)