Java tutorial
/** * Copyright (c) Acroquest Technology Co, Ltd. All Rights Reserved. * Please read the associated COPYRIGHTS file for more details. * * THE SOFTWARE IS PROVIDED BY Acroquest Technolog Co., Ltd., * WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDER BE LIABLE FOR ANY * CLAIM, DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ package acromusashi.stream.ml.anomaly.lof.entity; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; /** * Local Outlier Factor???? * * @author kimura */ public class LofPoint implements Serializable { /** serialVersionUID */ private static final long serialVersionUID = -7963512394458733906L; /** ID */ private String dataId; /** */ private double[] dataPoint; /** K? */ private double kDistance; /** K???ID */ private List<String> kDistanceNeighbor; /** ?? */ private double lrd; /** LOF?? */ private Date judgeDate; /** * ????? */ public LofPoint() { // Do nothing. } /** * ?DeepCopy?? * * @return ?DeepCopy */ public LofPoint deepCopy() { LofPoint result = new LofPoint(); result.setDataId(this.dataId); result.setkDistance(this.kDistance); double[] copiedArray = Arrays.copyOf(this.dataPoint, this.dataPoint.length); result.setDataPoint(copiedArray); List<String> copiedList = new ArrayList<>(); if (this.kDistanceNeighbor != null) { copiedList.addAll(this.kDistanceNeighbor); } result.setkDistanceNeighbor(copiedList); result.setLrd(this.lrd); return result; } /** * @return the dataId */ public String getDataId() { return this.dataId; } /** * @param dataId the dataId to set */ public void setDataId(String dataId) { this.dataId = dataId; } /** * @return the dataPoint */ public double[] getDataPoint() { return this.dataPoint; } /** * @param dataPoint the dataPoint to set */ public void setDataPoint(double[] dataPoint) { this.dataPoint = dataPoint; } /** * @return the kDistance */ public double getkDistance() { return this.kDistance; } /** * @param kDistance the kDistance to set */ public void setkDistance(double kDistance) { this.kDistance = kDistance; } /** * @return the kDistanceNeighbor */ public List<String> getkDistanceNeighbor() { return this.kDistanceNeighbor; } /** * @param kDistanceNeighbor the kDistanceNeighbor to set */ public void setkDistanceNeighbor(List<String> kDistanceNeighbor) { this.kDistanceNeighbor = kDistanceNeighbor; } /** * @return the lrd */ public double getLrd() { return this.lrd; } /** * @param lrd the lrd to set */ public void setLrd(double lrd) { this.lrd = lrd; } /** * @return the judgeDate */ public Date getJudgeDate() { return this.judgeDate; } /** * @param judgeDate the judgeDate to set */ public void setJudgeDate(Date judgeDate) { this.judgeDate = judgeDate; } /** * ??<br> * Storm?DRPC????<br> * (ReturnResultsReducer#complete(ReturnResultsState, TridentCollector))<br> * ?????JSON????????????????? * * @return ? */ @Override public String toString() { // TODO Storm???????? String result = "\"" + ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE) + "\""; return result; } }