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


Java TempList.addAll方法代码示例

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


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

示例1: override

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/**
 * Return the relational override of this and that; (if this tupleset and
 * that tupleset does not have compatible arity, then we return this
 * tupleset as is). <br/>
 * Note: in general, the tuples may be ordered arbitrarily in the result.
 */
public SimTupleset override(SimTupleset that) throws ErrorAPI {
	if (arity() == 1)
		return union(that);
	if (this.empty() || this == that)
		return that;
	if (that.empty() || this.arity() != that.arity())
		return this;
	if (that.longsize() == 1)
		return override(that.getTuple()); // very common case, so let's
											// optimize it
	TempList<SimTuple> ans = new TempList<SimTuple>(size());
	for (SimTuple x : this)
		if (!that.has(x))
			ans.add(x);
	ans.addAll(that);
	return new SimTupleset(ans.makeConst());
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:24,代码来源:SimTupleset.java

示例2: closure

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/** Returns the closure of this tupleset (NOTE: if this.arity!=2, we will return an empty set) */
public SimTupleset closure() {
   if (arity()!=2) return EMPTY;
   TempList<SimTuple> ar = new TempList<SimTuple>(size());
   ar.addAll(this);
   while(true) {
      int n = ar.size();
      for(int i=0; i<n; i++) {
         SimTuple left = ar.get(i);
         if (left.head()==left.tail()) continue;      // whatever "right" is, "left.right" won't add any new tuple to the final answer
         for(int j=0; j<n; j++) if (i!=j) {           // whatever "left" is,  "left.left"  won't add any new tuple to the final answer
            SimTuple right = ar.get(j);
            if (right.head()==right.tail()) continue; // whatever "left" is,  "left.right" won't add any new tuple to the final answer
            if (left.tail()==right.head() && find(ar, left.head(), right.tail())<0) ar.add(SimTuple.make(left.head(), right.tail()));
         }
      }
      if (n == ar.size()) return ar.size()==longsize() ? this : new SimTupleset(ar.makeConst()); // if we went through the loop without making any change, we're done
   }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:20,代码来源:SimTupleset.java

示例3: closure

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/**
 * Returns the closure of this tupleset (NOTE: if this.arity!=2, we will
 * return an empty set)
 */
public SimTupleset closure() {
	if (arity() != 2)
		return EMPTY;
	TempList<SimTuple> ar = new TempList<SimTuple>(size());
	ar.addAll(this);
	while (true) {
		int n = ar.size();
		for (int i = 0; i < n; i++) {
			SimTuple left = ar.get(i);
			if (left.head() == left.tail())
				continue; // whatever "right" is, "left.right" won't add any
							// new tuple to the final answer
			for (int j = 0; j < n; j++)
				if (i != j) { // whatever "left" is, "left.left" won't add
								// any new tuple to the final answer
					SimTuple right = ar.get(j);
					if (right.head() == right.tail())
						continue; // whatever "left" is, "left.right" won't
									// add any new tuple to the final answer
					if (left.tail() == right.head() && find(ar, left.head(), right.tail()) < 0)
						ar.add(SimTuple.make(left.head(), right.tail()));
				}
		}
		if (n == ar.size())
			return ar.size() == longsize() ? this : new SimTupleset(ar.makeConst()); // if
																						// we
																						// went
																						// through
																						// the
																						// loop
																						// without
																						// making
																						// any
																						// change,
																						// we're
																						// done
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:43,代码来源:SimTupleset.java

示例4: getAllReachableSigs

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/**
 * Return the list containing UNIV, SIGINT, SEQIDX, STRING, NONE, and all
 * sigs defined in this module or a reachable submodule.
 */
public ConstList<Sig> getAllReachableSigs() {
	TempList<Sig> x = new TempList<Sig>();
	x.add(UNIV);
	x.add(SIGINT);
	x.add(SEQIDX);
	x.add(STRING);
	x.add(NONE);
	x.addAll(getAllReachableUserDefinedSigs());
	return x.makeConst();
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:15,代码来源:CompModule.java

示例5: getAllReachableUserDefinedSigs

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/**
 * Return the list containing all sigs defined in this module or a reachable
 * submodule.
 */
public ConstList<Sig> getAllReachableUserDefinedSigs() {
	TempList<Sig> x = new TempList<Sig>();
	for (CompModule m : getAllReachableModules())
		x.addAll(m.sigs.values());
	return x.makeConst();
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:11,代码来源:CompModule.java

示例6: override

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/** Return the relational override of this and that; (if this tupleset and that tupleset does not have compatible arity, then we return this tupleset as is).
 * <br/> Note: in general, the tuples may be ordered arbitrarily in the result.
 */
public SimTupleset override(SimTupleset that) throws ErrorAPI {
   if (arity()==1) return union(that);
   if (this.empty() || this==that) return that;
   if (that.empty() || this.arity()!=that.arity()) return this;
   if (that.longsize()==1) return override(that.getTuple()); // very common case, so let's optimize it
   TempList<SimTuple> ans = new TempList<SimTuple>(size());
   for(SimTuple x: this) if (!that.has(x)) ans.add(x);
   ans.addAll(that);
   return new SimTupleset(ans.makeConst());
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:14,代码来源:SimTupleset.java

示例7: getAllReachableSigs

import edu.mit.csail.sdg.alloy4.ConstList.TempList; //导入方法依赖的package包/类
/** Return the list containing UNIV, SIGINT, SEQIDX, STRING, NONE, and all sigs defined in this module or a reachable submodule. */
public ConstList<Sig> getAllReachableSigs() {
   TempList<Sig> x = new TempList<Sig>();
   x.add(UNIV);
   x.add(SIGINT);
   x.add(SEQIDX);
   x.add(STRING);
   x.add(NONE);
   for(CompModule m:getAllReachableModules()) x.addAll(m.sigs.values());
   return x.makeConst();
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:12,代码来源:CompModule.java


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