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