当前位置: 首页>>代码示例>>Java>>正文


Java Arrays.deepEquals方法代码示例

本文整理汇总了Java中java.util.Arrays.deepEquals方法的典型用法代码示例。如果您正苦于以下问题:Java Arrays.deepEquals方法的具体用法?Java Arrays.deepEquals怎么用?Java Arrays.deepEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Arrays的用法示例。


在下文中一共展示了Arrays.deepEquals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compute

import java.util.Arrays; //导入方法依赖的package包/类
public final double[][] compute(final int K, final ArrayList<double[]> data, final ArrayList<Integer> dataClass, final ArrayList<Integer> dataIndex, 
		final int w, final int Imax, final int[] nbDataInClusters, final int[] clusterIndex) {
	final int[] centroidIndex = new int[K];
	final int[] clusterSeed = new int[data.size()];
	
	// initialize kmeans using kmeans++
	double[][] centroids = kmeanspp(K, data, w, centroidIndex, clusterSeed);
	
	for (int i = 0; i < Imax; i++) {
		System.out.println("Iterations " + (i+1));
		// recalculate new center
		double[][] newCentroids = clusterMean(K, centroids, clusterSeed, data, w, nbDataInClusters, clusterIndex);
		
		if (Arrays.deepEquals(centroids,newCentroids)) {
			break;
		} else {
			centroids = newCentroids;
			clusterAroundCentroid(data, centroids, w, clusterSeed);
		}
	}
	
	this.clusterSeed = clusterSeed;
	
	return centroids;
}
 
开发者ID:ChangWeiTan,项目名称:TSI,代码行数:26,代码来源:KMeansDTW.java

示例2: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(final Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (!(obj instanceof FunctionCall))
    return false;
  final FunctionCall other = (FunctionCall) obj;
  if (!Arrays.deepEquals(fields, other.fields))
    return false;
  if (!Arrays.equals(formatCodes, other.formatCodes))
    return false;
  if (functionResultFormatCode != other.functionResultFormatCode)
    return false;
  if (id != other.id)
    return false;
  return true;
}
 
开发者ID:traneio,项目名称:ndbc,代码行数:20,代码来源:Message.java

示例3: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final ComparableFK other = (ComparableFK) obj;
    if ((this.tableName == null) ? (other.tableName != null) : !this.tableName.equals(other.tableName)) {
        return false;
    }
    if ((this.refName == null) ? (other.refName != null) : !this.refName.equals(other.refName)) {
        return false;
    }

    if (!Arrays.deepEquals(this.lc, other.lc)) {
        return false;
    }
    if (!Arrays.deepEquals(this.rc, other.rc)) {
        return false;
    }
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:DbSchemaEjbGenerator.java

示例4: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final FixImpl other = (FixImpl) obj;
    if (!Arrays.deepEquals(this.keys, other.keys)) {
        return false;
    }
    if (this.handle != other.handle && (this.handle == null || !this.handle.equals(other.handle))) {
        return false;
    }
    if (this.file != other.file && (this.file == null || !this.file.equals(other.file))) {
        return false;
    }
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ErrorDescriptionFactory.java

示例5: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    LWM2MResource other = (LWM2MResource) obj;
    if (instances == null) {
        if (other.instances != null) {
            return false;
        }
    } else if (!Arrays.deepEquals(instances.toArray(), other.instances.toArray())) {
        return false;
    }
    return true;
}
 
开发者ID:ARMmbed,项目名称:mbed-cloud-sdk-java,代码行数:22,代码来源:LWM2MResource.java

示例6: isDefault

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean isDefault()
{
    if (isProperty)
    {
        if (!isList)
        {
            if (value != null)
                return value.equals(defaultValue);
            else
                return defaultValue == null;
        }
        else
        {
            return Arrays.deepEquals(values, defaultValues);
        }
    }
        
    return true;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:DummyConfigElement.java

示例7: equals

import java.util.Arrays; //导入方法依赖的package包/类
public final boolean equals(Object o1, Object o2) {
  if (o1 == null)
    return o2 == null;
  if (!(o1 instanceof Object[]) || !(o2 instanceof Object[])) {
    return o1.equals(o2);
  }
  return Arrays.deepEquals((Object[]) o1, (Object[]) o2);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:9,代码来源:StructBag.java

示例8: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
    if (o == this) return true;
    if (!(o instanceof FileMatch)) return false;
    final FileMatch other = (FileMatch)o;
    final Object[] thisconfig = toArray();
    final Object[] otherconfig = other.toArray();
    return Arrays.deepEquals(thisconfig,otherconfig);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:FileMatch.java

示例9: equals

import java.util.Arrays; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public boolean equals(Object obj) {
    if (this == obj)
        return true;

    if (obj == null || getClass() != obj.getClass())
        return false;

    KMeansModelFormat that = (KMeansModelFormat)obj;

    return distance.equals(that.distance) && Arrays.deepEquals(centers, that.centers);
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:13,代码来源:KMeansModelFormat.java

示例10: deepEquals

import java.util.Arrays; //导入方法依赖的package包/类
static boolean deepEquals(Object a, Object b) {
    if (a == null || b == null) {
        return a == b;
    }
    else if (a instanceof Object[] && b instanceof Object[]) {
        return Arrays.deepEquals((Object[]) a, (Object[]) b);
    }
    else if (a instanceof boolean[] && b instanceof boolean[]) {
        return Arrays.equals((boolean[]) a, (boolean[]) b);
    }
    else if (a instanceof byte[] && b instanceof byte[]) {
        return Arrays.equals((byte[]) a, (byte[]) b);
    }
    else if (a instanceof char[] && b instanceof char[]) {
        return Arrays.equals((char[]) a, (char[]) b);
    }
    else if (a instanceof double[] && b instanceof double[]) {
        return Arrays.equals((double[]) a, (double[]) b);
    }
    else if (a instanceof float[] && b instanceof float[]) {
        return Arrays.equals((float[]) a, (float[]) b);
    }
    else if (a instanceof int[] && b instanceof int[]) {
        return Arrays.equals((int[]) a, (int[]) b);
    }
    else if (a instanceof long[] && b instanceof long[]) {
        return Arrays.equals((long[]) a, (long[]) b);
    }
    else if (a instanceof short[] && b instanceof short[]) {
        return Arrays.equals((short[]) a, (short[]) b);
    }
    return a.equals(b);
}
 
开发者ID:Twelvelines,项目名称:AndroidMuseumBleManager,代码行数:34,代码来源:ObjectsCompat.java

示例11: points

import java.util.Arrays; //导入方法依赖的package包/类
private static GeoPoint[] points(GeoPoint[] original) {
    GeoPoint[] result = null;
    while (result == null || Arrays.deepEquals(original, result)) {
        int count = randomIntBetween(1, 10);
        result = new GeoPoint[count];
        for (int i = 0; i < count; i++) {
            result[i] = RandomGeoGenerator.randomPoint(random());
        }
    }
    return result;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:GeoDistanceSortBuilderTests.java

示例12: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    LWM2MObjectInstance other = (LWM2MObjectInstance) obj;
    if (id == null) {
        if (other.id != null) {
            return false;
        }
    } else if (!id.equals(other.id)) {
        return false;
    }
    if (resources == null) {
        if (other.resources != null) {
            return false;
        }
    } else if (!Arrays.deepEquals(resources.toArray(), other.resources.toArray())) {
        return false;
    }
    return true;
}
 
开发者ID:ARMmbed,项目名称:mbed-cloud-sdk-java,代码行数:29,代码来源:LWM2MObjectInstance.java

示例13: equals

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof BLEMeasurementsRecord)) return false;
    if (!super.equals(o)) return false;

    BLEMeasurementsRecord that = (BLEMeasurementsRecord) o;

    if (deviceCount != that.deviceCount) return false;
    if (!Arrays.deepEquals(deviceAddresses, that.deviceAddresses)) return false;
    if (!Arrays.deepEquals(deviceNames, that.deviceNames)) return false;
    if (!Arrays.equals(rssis, that.rssis)) return false;
    if (!Arrays.equals(deviceBondStatuses, that.deviceBondStatuses)) return false;
    if (!Arrays.equals(deviceTypes, that.deviceTypes)) return false;
    if (!Arrays.equals(timestampsNano, that.timestampsNano)) return false;
    if (!Arrays.equals(advertisingSids, that.advertisingSids)) return false;
    if (!Arrays.equals(dataStatuses, that.dataStatuses)) return false;
    if (!Arrays.equals(periodicAdvertisingIntervals, that.periodicAdvertisingIntervals))
        return false;
    if (!Arrays.equals(primaryPhies, that.primaryPhies)) return false;
    if (!Arrays.equals(secondaryPhies, that.secondaryPhies)) return false;
    if (!Arrays.equals(txPowers, that.txPowers)) return false;
    if (!Arrays.equals(areConnectable, that.areConnectable)) return false;
    if (!Arrays.equals(areLegacy, that.areLegacy)) return false;
    if (!Arrays.equals(uuids, that.uuids)) return false;
    if (!Arrays.equals(majors, that.majors)) return false;
    return Arrays.equals(minors, that.minors);
}
 
开发者ID:ubikgs,项目名称:AndroidSensors,代码行数:29,代码来源:BLEMeasurementsRecord.java

示例14: equals

import java.util.Arrays; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public boolean equals(Object obj) {
    if (this == obj)
        return true;

    if (obj == null || getClass() != obj.getClass())
        return false;

    KNNModel that = (KNNModel)obj;

    return k == that.k && distanceMeasure.equals(that.distanceMeasure) && stgy.equals(that.stgy)
        && Arrays.deepEquals(training.data(), that.training.data());
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:14,代码来源:KNNModel.java

示例15: testTheTest

import java.util.Arrays; //导入方法依赖的package包/类
private static void testTheTest(String[] pkgs, char[][] chars,
                                int[][] states) {

    PackageMatcher m = new TestPackageMatcher(pkgs);
    String unexpected = "";
    if (!Arrays.deepEquals(chars, m.chars)) {
        System.err.println("Char arrays differ");
        if (chars.length != m.chars.length) {
            System.err.println("Char array lengths differ: expected="
                    + chars.length + " actual=" + m.chars.length);
        }
        System.err.println(Arrays.deepToString(m.chars).replace((char)0,
                                               '0'));
        unexpected = "chars[]";
    }
    if (!Arrays.deepEquals(states, m.states)) {
        System.err.println("State arrays differ");
        if (states.length != m.states.length) {
            System.err.println("Char array lengths differ: expected="
                    + states.length + " actual=" + m.states.length);
        }
        System.err.println(Arrays.deepToString(m.states));
        if (unexpected.length() > 0) {
            unexpected = unexpected + " and ";
        }
        unexpected = unexpected + "states[]";
    }

    if (unexpected.length() > 0) {
        throw new Error("Unexpected "+unexpected+" in PackageMatcher");
    }

    testMatches(m, pkgs);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:CheckPackageMatching.java


注:本文中的java.util.Arrays.deepEquals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。