class name typo
This commit is contained in:
parent
cb66248b5a
commit
ec5671e23c
|
@ -0,0 +1,15 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
|
||||
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WeakerAccess" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
|
||||
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="true" />
|
||||
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
|
@ -49,7 +49,7 @@ public class AdcFilter {
|
|||
FileUtils.saveList("v2.csv", values);
|
||||
|
||||
|
||||
final List<Double> medianValues = MedialFilter.filter(values, 5);
|
||||
final List<Double> medianValues = MedianFilter.filter(values, 5);
|
||||
FileUtils.saveList("v_med.csv", medianValues);
|
||||
|
||||
|
||||
|
|
|
@ -8,33 +8,28 @@ import java.util.List;
|
|||
* @author Andrey Belomutskiy
|
||||
* 8/5/13
|
||||
*/
|
||||
public class MedialFilter {
|
||||
|
||||
|
||||
public class MedianFilter {
|
||||
private List<Double> values;
|
||||
private int size;
|
||||
|
||||
|
||||
|
||||
|
||||
public MedialFilter(List<Double> values, int size) {
|
||||
public MedianFilter(List<Double> values, int size) {
|
||||
this.values = values;
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public static List<Double> filter(List<Double> values, int size) {
|
||||
return new MedialFilter(values, size).filter();
|
||||
return new MedianFilter(values, size).filter();
|
||||
}
|
||||
|
||||
private List<Double> filter() {
|
||||
|
||||
List<Double> result = new ArrayList<Double>();
|
||||
List<Double> result = new ArrayList<>();
|
||||
|
||||
for(int i=0;i<values.size();i++) {
|
||||
|
||||
int fromIndex = Math.max(0, i - size);
|
||||
|
||||
List<Double> copy = new ArrayList<Double>(values.subList(fromIndex, i+1));
|
||||
List<Double> copy = new ArrayList<>(values.subList(fromIndex, i + 1));
|
||||
|
||||
Collections.sort(copy);
|
||||
|
Loading…
Reference in New Issue