java.util.ArrayList#equals ( )源码实例Demo

下面列出了java.util.ArrayList#equals ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: InviZible   文件: PreferencesDNSCryptServers.java
private void saveOwnDNSCryptServersIfChanged(Context context) {
    ArrayList<DNSServerItem> newOwnItems = new ArrayList<>();
    ArrayList<String> linesReadyToSave = new ArrayList<>();

    for (DNSServerItem dnsServerItem: list_dns_servers) {
        if (dnsServerItem.getOwnServer()) {
            linesReadyToSave.add("## " + dnsServerItem.getName());
            linesReadyToSave.add(dnsServerItem.getDescription());
            linesReadyToSave.add("sdns://" + dnsServerItem.getSDNS());

            newOwnItems.add(dnsServerItem);
        }
    }

    if (newOwnItems.equals(savedOwnDNSCryptServers)) {
        return;
    }

    FileOperations.writeToTextFile(context, ownServersFilePath, linesReadyToSave,  "ignored");

}
 
源代码2 项目: Concurnas   文件: GPUKernalFuncTranspiler.java
private ArrayList<Integer> validateArrayInstanitation(ArrayElementGettable ad){
	ArrayList<Integer> sizes = new ArrayList<Integer>();
	ArrayList<Expression> items = ad.getArrayElements(this);
	sizes.add(items.size());
	
	ArrayList<Integer> nextlevelsizes = null;
	for(Expression item : items) {
		if(item instanceof ArrayDef) {
			ArrayList<Integer> nevlevel = validateArrayInstanitation((ArrayDef)item );
			if(null == nextlevelsizes) {
				nextlevelsizes = nevlevel;
			}else {
				//ensue match with preoiuvs one
				if(!nextlevelsizes.equals(nevlevel)) {
					raiseErrorNoUse(((Expression)ad).getLine(), ((Expression)ad).getColumn(), "unequal n dimentional array subarray instantiation");
				}
			}
		}
	}
	
	if(null != nextlevelsizes) {
		sizes.addAll(nextlevelsizes);
	}
			
	return sizes;
}
 
源代码3 项目: crate   文件: Collect.java
@Override
public LogicalPlan pruneOutputsExcept(TableStats tableStats, Collection<Symbol> outputsToKeep) {
    ArrayList<Symbol> newOutputs = new ArrayList<>();
    for (Symbol output : outputs) {
        if (outputsToKeep.contains(output)) {
            newOutputs.add(output);
        }
    }
    if (newOutputs.equals(outputs)) {
        return this;
    }
    Stats stats = tableStats.getStats(relation.relationName());
    return new Collect(
        preferSourceLookup,
        relation,
        newOutputs,
        where,
        numExpectedRows,
        stats.estimateSizeForColumns(newOutputs)
    );
}
 
源代码4 项目: jaamsim   文件: SampleListInput.java
public void setUnitTypeList(ArrayList<Class<? extends Unit>> utList) {

		if (utList.equals(unitTypeList))
			return;

		// Save the new unit types
		unitTypeList = new ArrayList<>(utList);
		this.setValid(false);

		// Set the units for the default value column in the Input Editor
		if (defValue == null)
			return;
		for (int i=0; i<defValue.size(); i++) {
			SampleProvider p = defValue.get(i);
			if (p instanceof SampleConstant)
				((SampleConstant) p).setUnitType(getUnitType(i));
		}
	}
 
源代码5 项目: MikuMikuStudio   文件: DOMOutputCapsule.java
public void writeSavableArrayList(ArrayList array, String name, ArrayList defVal) throws IOException {
    if (array == null) {
        return;
    }
    if (array.equals(defVal)) {
        return;
    }
    Element old = currentElement;
    Element el = appendElement(name);
    currentElement = el;
    el.setAttribute(XMLExporter.ATTRIBUTE_SIZE, String.valueOf(array.size()));
    for (Object o : array) {
            if(o == null) {
                    continue;
            }
            else if (o instanceof Savable) {
            Savable s = (Savable) o;
            write(s, s.getClass().getName(), null);
        } else {
            throw new ClassCastException("Not a Savable instance: " + o);
        }
    }
    currentElement = old;
}
 
源代码6 项目: Wurst7   文件: Navigator.java
public void copyNavigatorList(ArrayList<Feature> list)
{
	if(list.equals(navigatorList))
		return;
	
	list.clear();
	list.addAll(navigatorList);
}
 
源代码7 项目: MikuMikuStudio   文件: DOMOutputCapsule.java
public void writeFloatBufferArrayList(ArrayList<FloatBuffer> array, String name, ArrayList<FloatBuffer> defVal) throws IOException {
    if (array == null) {
        return;
    }
    if (array.equals(defVal)) {
        return;
    }
    Element el = appendElement(name);
    el.setAttribute(XMLExporter.ATTRIBUTE_SIZE, String.valueOf(array.size()));
    for (FloatBuffer o : array) {
        write(o, XMLExporter.ELEMENT_FLOATBUFFER, null);
    }
    currentElement = (Element) el.getParentNode();
}
 
源代码8 项目: Concurnas   文件: ScopeAndTypeTests.java
private void compareWithExpected(File expected, ArrayList<ErrorHolder> gota) throws Exception
{
	BufferedReader br = new BufferedReader(new FileReader(expected));
	try
	{
		ArrayList<String> got = Utils.erListToStrList(gota);
		ArrayList<String> expectedErrs = new ArrayList<String>();
		
		String sCurrentLine = null;
		
		while((sCurrentLine = br.readLine()) != null)
		{
			expectedErrs.add(sCurrentLine);
		}
		
		if(!got.equals(expectedErrs))
		{
			String expStr = listToStr(expectedErrs);
			String gotStr = listToStr(got);
			throw new junit.framework.ComparisonFailure("Expected messages does not match obtained", expStr, gotStr);
			
		}
	}
	catch(Exception e)
	{
		throw e;
	}
	finally
	{
		br.close();
	}
}
 
private void doPersistColumnsConfig(ArrayList<Pair<Integer, Integer>> columnsConfig) {
	if (columnsConfig.equals(prevColumnsConfig)) {
		return;
	}
	prevColumnsConfig = columnsConfig;
	configPairs.put(keyId, columnsConfig);
}
 
源代码10 项目: Shield   文件: SectionRecyclerCellManager.java
private void setVisibleAgentToWhiteBoard() {
    if (whiteBoard != null) {
        ArrayList<String> visibleAgentList = mergeRecyclerAdapter.getAgentVisibiltyList();
        if (visibleAgentList.size() != oldVisibleAgentList.size() || !visibleAgentList.equals(oldVisibleAgentList)) {
            oldVisibleAgentList = visibleAgentList;
            whiteBoard.putSerializable(ShieldConst.AGENT_VISIBILITY_LIST_KEY, visibleAgentList);
        }
    }
}
 
源代码11 项目: gef   文件: ChangeSelectionOperation.java
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	SelectionModel selectionModel = getSelectionModel();
	ArrayList<IContentPart<? extends Node>> currentSelection = new ArrayList<>(
			selectionModel.getSelectionUnmodifiable());
	if (!currentSelection.equals(finalSelection)) {
		selectionModel.setSelection(finalSelection);
	}
	return Status.OK_STATUS;
}
 
源代码12 项目: gef   文件: ChangeSelectionOperation.java
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	SelectionModel selectionModel = getSelectionModel();

	ArrayList<IContentPart<? extends Node>> currentSelection = new ArrayList<>(
			selectionModel.getSelectionUnmodifiable());
	if (!currentSelection.equals(initialSelection)) {
		selectionModel.setSelection(initialSelection);
	}

	return Status.OK_STATUS;
}
 
源代码13 项目: flow   文件: AbstractDebounceSynchronizeIT.java
private boolean checkMessages(String... expectedMessages) {
    ArrayList<String> messages = findElements(By.cssSelector("#messages p"))
            .stream().map(WebElement::getText)
            .map(text -> text.replaceFirst("Value: ", ""))
            .collect(Collectors.toCollection(ArrayList::new));
    return messages
            .equals(new ArrayList<String>(Arrays.asList(expectedMessages)));
}
 
源代码14 项目: cst   文件: Behavior.java
public synchronized boolean changedWorldBeliefState() {
	ArrayList<Object> temp1= new ArrayList<Object>();
	ArrayList<Object> temp2= new ArrayList<Object>();

	temp1.addAll(listOfWorldBeliefStates);
	temp2.addAll(listOfPreviousWorldBeliefStates);

	return 	(!temp1.equals(temp2));
}
 
源代码15 项目: onos   文件: DefaultRoutingHandler.java
/**
 * For the root switch, searches all the target nodes reachable in the base
 * graph, and compares paths to the ones in the comp graph.
 *
 * @param base the graph that is indexed for all reachable target nodes
 *             from the root node
 * @param comp the graph that the base graph is compared to
 * @param rootSw  both ecmp graphs are calculated for the root node
 * @return all the routes that have changed in the base graph
 */
private Set<ArrayList<DeviceId>> compareGraphs(EcmpShortestPathGraph base,
                                               EcmpShortestPathGraph comp,
                                               DeviceId rootSw) {
    ImmutableSet.Builder<ArrayList<DeviceId>> changedRoutesBuilder =
            ImmutableSet.builder();
    HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> baseMap =
            base.getAllLearnedSwitchesAndVia();
    HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> compMap =
            comp.getAllLearnedSwitchesAndVia();
    for (Integer itrIdx : baseMap.keySet()) {
        HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>> baseViaMap =
                baseMap.get(itrIdx);
        for (DeviceId targetSw : baseViaMap.keySet()) {
            ArrayList<ArrayList<DeviceId>> basePath = baseViaMap.get(targetSw);
            ArrayList<ArrayList<DeviceId>> compPath = getVia(compMap, targetSw);
            if ((compPath == null) || !basePath.equals(compPath)) {
                log.trace("Impacted route:{} -> {}", targetSw, rootSw);
                ArrayList<DeviceId> route = new ArrayList<>();
                route.add(targetSw); // switch with rules to populate
                route.add(rootSw); // towards this destination
                changedRoutesBuilder.add(route);
            }
        }
    }
    return changedRoutesBuilder.build();
}
 
源代码16 项目: SeaCloudsPlatform   文件: BusinessValueList.java
public boolean equals(BusinessValueList other) {
    
    /*
     * list compare is broken if using hibernate.
     */
    ArrayList<IPenaltyDefinition> aux = new ArrayList<IPenaltyDefinition>(getPenalties());
    
    boolean result = importance == other.getImportance() &&
            aux.equals(other.getPenalties());
    return result;
}
 
源代码17 项目: InviZible   文件: PreferencesDNSCryptServers.java
private boolean saveOwnServersToTomlList() {
    if (dnscrypt_proxy_toml == null) {
        return false;
    }

    ArrayList<String> newLines = new ArrayList<>();

    newLines.add("[static]");
    for (DNSServerItem dnsServerItem: list_dns_servers) {
        if (dnsServerItem.getOwnServer()) {
            newLines.add("[static.'" + dnsServerItem.getName() + "']");
            newLines.add("stamp = 'sdns:" + dnsServerItem.getSDNS() + "'");
        }
    }

    ArrayList<String> oldLines = new ArrayList<>();

    boolean lockStatic = false;

    for (int i = 0; i < dnscrypt_proxy_toml.size(); i++) {

        String line = dnscrypt_proxy_toml.get(i);

        if (line.contains("[static]")) {
            lockStatic = true;
            oldLines.add(line);
        } else if (line.contains("[") && line.contains("]") && !line.contains("static") && lockStatic) {
            lockStatic = false;
        } else if (lockStatic){
            oldLines.add(line);
        }
    }

    if (newLines.equals(oldLines)) {
        return false;
    }

    dnscrypt_proxy_toml.removeAll(oldLines);

    dnscrypt_proxy_toml.addAll(newLines);

    return true;
}
 
源代码18 项目: AOSP-Kayboard-7.1.2   文件: WordProperty.java
private static <T> boolean equals(final ArrayList<T> a, final ArrayList<T> b) {
    if (null == a) {
        return null == b;
    }
    return a.equals(b);
}
 
源代码19 项目: Indic-Keyboard   文件: WordProperty.java
private static <T> boolean equals(final ArrayList<T> a, final ArrayList<T> b) {
    if (null == a) {
        return null == b;
    }
    return a.equals(b);
}
 
源代码20 项目: MavenHelper   文件: AliasTable.java
public boolean isModified(ApplicationSettings settings) {
	final ArrayList<Alias> aliases = new ArrayList<>();
	obtainAliases(aliases, settings);
	return !aliases.equals(myAliases);
}