本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}