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


Java SparseSequence.isEmpty方法代码示例

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


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

示例1: and

import kodkod.util.ints.SparseSequence; //导入方法依赖的package包/类
/**
 * Returns a new matrix such that an entry in the returned matrix represents
 * a conjunction of the corresponding entries in this and other matrix. The
 * effect of this method is the same as calling
 * this.compose(ExprOperator.Binary.AND, other).
 *
 * @return { m: BooleanMatrix | m.dimensions = this.dimensions && m.factory
 *         = this.factory && all i: [0..m.dimensions.capacity) |
 *         m.elements[i] = this.elements[i] AND other.elements[i] }
 * @throws NullPointerException other = null
 * @throws IllegalArgumentException
 *             !other.dimensions.equals(this.dimensions) || this.factory !=
 *             other.factory
 */
public final BooleanMatrix and(BooleanMatrix other) {
	checkFactory(this.factory, other.factory);
	checkDimensions(this.dims, other.dims);

	final BooleanMatrix ret = new BooleanMatrix(dims, factory, cells, other.cells);
	ret.mergeDefConds(this, other);

	final SparseSequence<BooleanValue> s1 = other.cells;
	if (cells.isEmpty() || s1.isEmpty())
		return ret;
	for (IndexedEntry<BooleanValue> e0 : cells) {
		BooleanValue v1 = s1.get(e0.index());
		if (v1 != null)
			ret.fastSet(e0.index(), factory.and(e0.value(), v1));
	}
	return ret;
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:32,代码来源:BooleanMatrix.java

示例2: and

import kodkod.util.ints.SparseSequence; //导入方法依赖的package包/类
/**
 * Returns a new matrix such that an entry in the returned matrix represents a 
 * conjunction of the corresponding entries in this and other matrix.  The effect 
 * of this method is the same as calling this.compose(ExprOperator.Binary.AND, other).
 * 
 * @return { m: BooleanMatrix | m.dimensions = this.dimensions && m.factory = this.factory &&
 *                              all i: [0..m.dimensions.capacity) | 
 *                               m.elements[i] = this.elements[i] AND other.elements[i] }
 * @throws NullPointerException  other = null
 * @throws IllegalArgumentException  !other.dimensions.equals(this.dimensions) || this.factory != other.factory
 */
public final BooleanMatrix and(BooleanMatrix  other) {
	checkFactory(this.factory, other.factory); 
	checkDimensions(this.dims, other.dims);
	final BooleanMatrix ret = new BooleanMatrix(dims, factory, cells, other.cells);
	final SparseSequence<BooleanValue> s1 = other.cells;
	if (cells.isEmpty() || s1.isEmpty()) return ret;
	for(IndexedEntry<BooleanValue> e0 : cells) {
		BooleanValue v1 = s1.get(e0.index());
		if (v1!=null)
			ret.fastSet(e0.index(), factory.and(e0.value(), v1));
	}
	return ret;
}
 
开发者ID:emina,项目名称:kodkod,代码行数:25,代码来源:BooleanMatrix.java


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