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


Java BitSet.or方法代码示例

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


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

示例1: getMessageForConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility in charge of creating the message when the class is not
 * consistent within a specific context
 *
 * @param minBitset
 *            bitset describing which CIM attributes of this class have
 *            to be set so that it is consistent within a
 *            specific subset context
 * @return the message explaining what is not consistent
 */
private String getMessageForConsistency(final BitSet minBitset) {

    StringBuilder message = new StringBuilder(
            "Instance of \"HydroPump\" of id \"");
    message.append(this.getId());
    message.append("\" is not consistent in this context:\n");
    /*
     * XOR and then AND
     * The result is :
     * "1" : has not been set and need to be
     * "0" : has been set or is not mandatory
     */

    BitSet isNotSet = new BitSet(minBitset.length());
    isNotSet.or(minBitset);
    // we create a copy of minBitset
    isNotSet.xor(this.currentBitset);
    isNotSet.and(minBitset);

    if (isNotSet.get(0)) {
        message.append("\t\"DrivenBy_SynchronousMachine\" needs to be set\n");
    }
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:35,代码来源:HydroPump.java

示例2: modelConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility to check whether this class is consistent in a "merged" context
 *
 * @return a ConsistencyCheck instance whose boolean attribute (consistent)
 *         indicates if this class is consistent and whose String attribute
 *         (message)
 *         indicates why this class is not consistent if it is not
 */
@Override
public ConsistencyCheck modelConsistency() {
    BitSet intersection = new BitSet(this.minBitset.length());
    intersection.or(this.minBitset);
    // we create a copy of minBitSet
    intersection.and(this.currentBitset);
    boolean consistent = (this.minBitset.equals(intersection));
    StringBuilder message = new StringBuilder("");

    if (!consistent) {
    message.append(getMessageForConsistency(this.minBitset));
    }

    return new ConsistencyCheck(consistent, message.toString());
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:24,代码来源:CurveData.java

示例3: modelConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility to check whether this class is consistent according to a subset
 *
 * @param subset
 *            the subset defining the context in which to check whether this class is consistent
 * @return a ConsistencyCheck instance whose boolean attribute (consistent)
 *         indicates if this class is consistent and whose String attribute
 *         (message)
 *         indicates why this class is not consistent if it is not
 */
@Override
public ConsistencyCheck modelConsistency(final Subset subset) {
    BitSet intersection = new BitSet(this.minBitsets.get(subset).length());
    intersection.or(this.minBitsets.get(subset));
    // we create a copy of minBitsets.get(subset)
    intersection.and(this.currentBitset);
    boolean consistent = (this.minBitsets.get(subset).equals(intersection));
    StringBuilder message = new StringBuilder("");

    if (!consistent) {
        message.append(getMessageForConsistency(this.minBitsets.get(subset)));
    }

    return new ConsistencyCheck(consistent, message.toString());
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:26,代码来源:ControlAreaGeneratingUnit.java

示例4: getMessageForConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility in charge of creating the message when the class is not
 * consistent within a specific context
 *
 * @param minBitset
 *            bitset describing which CIM attributes of this class have
 *            to be set so that it is consistent within a
 *            specific subset context
 * @return the message explaining what is not consistent
 */
private String getMessageForConsistency(final BitSet minBitset) {

    StringBuilder message = new StringBuilder(
            "Instance of \"Equipment\" of id \"");
    message.append(this.getId());
    message.append("\" is not consistent in this context:\n");
    /*
     * XOR and then AND
     * The result is :
     * "1" : has not been set and need to be
     * "0" : has been set or is not mandatory
     */

    BitSet isNotSet = new BitSet(minBitset.length());
    isNotSet.or(minBitset);
    // we create a copy of minBitset
    isNotSet.xor(this.currentBitset);
    isNotSet.and(minBitset);

    if (isNotSet.get(0)) {
        message.append("\t\"equivalent\" needs to be set\n");
    }

    if (isNotSet.get(1)) {
        message.append("\t\"MemberOf_EquipmentContainer\" needs to be set\n");
    }
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:39,代码来源:Equipment.java

示例5: setBits

import java.util.BitSet; //导入方法依赖的package包/类
@GwtIncompatible // used only from other GwtIncompatible code
@Override
void setBits(BitSet table) {
  BitSet tmp = new BitSet();
  original.setBits(tmp);
  tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  table.or(tmp);
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:9,代码来源:CharMatcher.java

示例6: modelConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility to check whether this class is consistent according to a subset
 *
 * @param subset
 *            the subset defining the context in which to check whether this class is consistent
 * @return a ConsistencyCheck instance whose boolean attribute (consistent)
 *         indicates if this class is consistent and whose String attribute
 *         (message)
 *         indicates why this class is not consistent if it is not
 */
@Override
public ConsistencyCheck modelConsistency(final Subset subset) {
    BitSet intersection = new BitSet(this.minBitsets.get(subset).length());
    intersection.or(this.minBitsets.get(subset));
    // we create a copy of minBitsets.get(subset)
    intersection.and(this.currentBitset);
    boolean consistent = (this.minBitsets.get(subset).equals(intersection));
    StringBuilder message = new StringBuilder("");

    if (!consistent) {
        message.append(getMessageForConsistency(this.minBitsets.get(subset)));
    }
    // consistent = (super.modelConsistency().getLeft()) ? (consistent &&
    // (true)):(consistent && (false))
    // message.append((super.modelConsistency(subset)).getRight());

    if (super.modelConsistency().isConsistent()) {
        consistent = consistent && (true);
        message.append((super.modelConsistency(subset)).getMessage());
    } else {
        consistent = consistent && (false);
        message.append((super.modelConsistency(subset)).getMessage());
    }

    return new ConsistencyCheck(consistent, message.toString());
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:37,代码来源:FossilFuel.java

示例7: modelConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility to check whether this class is consistent in a "merged" context
 *
 * @return a ConsistencyCheck instance whose boolean attribute (consistent)
 *         indicates if this class is consistent and whose String attribute
 *         (message)
 *         indicates why this class is not consistent if it is not
 */
@Override
public ConsistencyCheck modelConsistency() {
    BitSet intersection = new BitSet(this.minBitset.length());
    intersection.or(this.minBitset);
    // we create a copy of minBitSet
    intersection.and(this.currentBitset);
    boolean consistent = (this.minBitset.equals(intersection));
    StringBuilder message = new StringBuilder("");

    if (!consistent) {
    message.append(getMessageForConsistency(this.minBitset));
    }
    // consistent = (super.modelConsistency().getLeft()) ? (consistent &&
    // (true)):(consistent && (false))
    // message += (super.modelConsistency(subset)).getRight();

    if (super.modelConsistency().isConsistent()) {
        consistent = consistent && (true);
        message.append((super.modelConsistency()).getMessage());
    } else {
        consistent = consistent && (false);
        message.append((super.modelConsistency()).getMessage());
    }

    return new ConsistencyCheck(consistent, message.toString());
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:35,代码来源:SubGeographicalRegion.java

示例8: getMessageForConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility in charge of creating the message when the class is not
 * consistent within a specific context
 *
 * @param minBitset
 *            bitset describing which CIM attributes of this class have
 *            to be set so that it is consistent within a
 *            specific subset context
 * @return the message explaining what is not consistent
 */
private String getMessageForConsistency(final BitSet minBitset) {

    StringBuilder message = new StringBuilder(
            "Instance of \"SvShuntCompensatorSections\" of id \"");
    message.append(this.getId());
    message.append("\" is not consistent in this context:\n");
    /*
     * XOR and then AND
     * The result is :
     * "1" : has not been set and need to be
     * "0" : has been set or is not mandatory
     */

    BitSet isNotSet = new BitSet(minBitset.length());
    isNotSet.or(minBitset);
    // we create a copy of minBitset
    isNotSet.xor(this.currentBitset);
    isNotSet.and(minBitset);

    if (isNotSet.get(0)) {
        message.append("\t\"ShuntCompensator\" needs to be set\n");
    }

    if (isNotSet.get(1)) {
        message.append("\t\"continuousSections\" needs to be set\n");
    }
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:39,代码来源:SvShuntCompensatorSections.java

示例9: setBits

import java.util.BitSet; //导入方法依赖的package包/类
@GwtIncompatible("java.util.BitSet")
@Override
void setBits(BitSet table) {
  BitSet tmp = new BitSet();
  original.setBits(tmp);
  tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  table.or(tmp);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:9,代码来源:CharMatcher.java

示例10: computeOr

import java.util.BitSet; //导入方法依赖的package包/类
/** Returns the disjunction of two bit sets. */
private BitSet computeOr(BitSet arg1, BitSet arg2) {
    BitSet result = (BitSet) arg1.clone();
    result.or(arg2);
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:7,代码来源:CTLMarker.java

示例11: setPhiFunctions

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Sets the phi-functions for each virtual variable of each fork node.
 */
private void setPhiFunctions() {
	List<WGNode> forks = new ArrayList<WGNode>(graph.getForkList());
	forks.addAll(graph.getOrForkList());
	BitSet defineEdges = new BitSet(this.edges.size());
	for (WGNode fork : forks) {
		// An edge is visited
		edgesVisited++;

		// Get the incoming edge
		Edge in = edges.get(incoming[fork.getId()].nextSetBit(0));

		// Get the edges where the virtual variables are defined
		// (i.e., the outgoing edges of the fork)
		defineEdges.clear();
		defineEdges.or(outgoing[fork.getId()]);
		while (!defineEdges.isEmpty()) {
			// An edge is visited
			edgesVisited++;

			int next = defineEdges.nextSetBit(0);
			defineEdges.clear(next);
			Edge n = edges.get(next);
			
			// If the edge is the outgoing edge of the fork...
			if (n.src.getId() == fork.getId()) {
				// ... and the fork is within a cycle ...
				if (in.bond.get(in.id)) {
					// ... then it could be important meeting point
					this.meetingPoints[fork.getId()].set(n.id);
					this.hasDefinitions.set(n.id);
				}
			} else {
				// It is an important meeting point
				meetingPoints[fork.getId()].set(n.id);
				if (n.src.getType() != Type.JOIN && 
					n.src.getType() != Type.OR_JOIN) {
					this.hasDefinitions.set(n.id);
				}
			}

			for (int s = n.dominanceFrontierSet.nextSetBit(0); s >= 0; s = n.dominanceFrontierSet
					.nextSetBit(s + 1)) {
				// An edge is visited
				edgesVisited++;

				Edge syncEdge = edges.get(s);
				if (!in.syncEdges.get(syncEdge.id)) {
					in.syncEdges.set(syncEdge.id);


					meetingPoints[fork.getId()].set(syncEdge.id);
					if (syncEdge.src.getType() != Type.JOIN && 
						syncEdge.src.getType() != Type.OR_JOIN) {
						this.hasDefinitions.set(syncEdge.id);
					}

					if (in.postDominatorList.getLast().id != syncEdge.id
							&& n.postDominatorList.getLast().id != syncEdge.id) {
						if (in.bond.get(syncEdge.id)) {
							defineEdges.set(syncEdge.id);
						}
					}
				}
			}
		}
	}
}
 
开发者ID:guybrushPrince,项目名称:mojo.core,代码行数:71,代码来源:AbundanceAnalysis.java

示例12: getMessageForConsistency

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Utility in charge of creating the message when the class is not
 * consistent within a specific context
 *
 * @param minBitset
 *            bitset describing which CIM attributes of this class have
 *            to be set so that it is consistent within a
 *            specific subset context
 * @return the message explaining what is not consistent
 */
private String getMessageForConsistency(final BitSet minBitset) {

    StringBuilder message = new StringBuilder(
            "Instance of \"TopologicalNode\" of id \"");
    message.append(this.getId());
    message.append("\" is not consistent in this context:\n");
    /*
     * XOR and then AND
     * The result is :
     * "1" : has not been set and need to be
     * "0" : has been set or is not mandatory
     */

    BitSet isNotSet = new BitSet(minBitset.length());
    isNotSet.or(minBitset);
    // we create a copy of minBitset
    isNotSet.xor(this.currentBitset);
    isNotSet.and(minBitset);

    if (isNotSet.get(0)) {
        message.append("\t\"equivalent\" needs to be set\n");
    }

    if (isNotSet.get(1)) {
        message.append("\t\"x0PerX\" needs to be set\n");
    }

    if (isNotSet.get(2)) {
        message.append("\t\"AngleRef_TopologicalIsland\" needs to be set\n");
    }

    if (isNotSet.get(3)) {
        message.append("\t\"SvVoltage\" needs to be set\n");
    }

    if (isNotSet.get(4)) {
        message.append("\t\"ConnectivityNodeContainer\" needs to be set\n");
    }

    if (isNotSet.get(5)) {
        message.append("\t\"Terminal\" needs to be set\n");
    }

    if (isNotSet.get(6)) {
        message.append("\t\"sShortCircuit\" needs to be set\n");
    }

    if (isNotSet.get(7)) {
        message.append("\t\"TopologicalIsland\" needs to be set\n");
    }

    if (isNotSet.get(8)) {
        message.append("\t\"BaseVoltage\" needs to be set\n");
    }

    if (isNotSet.get(9)) {
        message.append("\t\"r0PerR\" needs to be set\n");
    }

    if (isNotSet.get(10)) {
        message.append("\t\"ControlArea\" needs to be set\n");
    }

    if (isNotSet.get(11)) {
        message.append("\t\"xPerR\" needs to be set\n");
    }
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:79,代码来源:TopologicalNode.java

示例13: applyExcludes

import java.util.BitSet; //导入方法依赖的package包/类
void applyExcludes(final SearchableString userAgent, final BitSet resultExcludes) {
    if (!myUserAgentPredicate.test(userAgent)) {
        resultExcludes.or(myMask);
    }
}
 
开发者ID:blueconic,项目名称:browscap-java,代码行数:6,代码来源:UserAgentParserImpl.java


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