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


Java BitSet.and方法代码示例

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


在下文中一共展示了BitSet.and方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 \"EquivalentEquipment\" 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);
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:31,代码来源:EquivalentEquipment.java

示例2: 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,代码来源:IdentifiedObject.java

示例3: 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,代码来源:IEC61970CIMVersion.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 \"NuclearGeneratingUnit\" 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);
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:31,代码来源:NuclearGeneratingUnit.java

示例5: 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,代码来源:RegulatingControl.java

示例6: and

import java.util.BitSet; //导入方法依赖的package包/类
/**
 * Return logical-and of 'columns'.
 * @param columns
 * @return
 */
public BitSet and(Collection<Integer> columns) {
	if (columns == null) return null;
	Iterator<Integer> keyIter = columns.iterator();
	BitSet set = (BitSet) getColumn(keyIter.next()).clone();
	while (keyIter.hasNext()) {
		set.and(getColumn(keyIter.next()));
	}
	return set;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:15,代码来源:BitMatrix.java

示例7: updateEntrySet

import java.util.BitSet; //导入方法依赖的package包/类
private boolean updateEntrySet(BitSet entrySet, BitSet exitSet,
                               BitSet useBeforeDef, BitSet notDef) {
    int card = entrySet.cardinality();
    entrySet.or(exitSet);
    entrySet.and(notDef);
    entrySet.or(useBeforeDef);
    return entrySet.cardinality() != card;
}
 
开发者ID:MikaGuraN,项目名称:HL4A,代码行数:9,代码来源:Block.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 \"SubGeographicalRegion\" 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\"Region\" needs to be set\n");
    }

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

示例9: 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,代码来源:Equipment.java

示例10: 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

示例11: 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 \"Conductor\" 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\"g0ch\" needs to be set\n");
    }

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

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

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

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

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

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

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

    if (isNotSet.get(8)) {
        message.append("\t\"r0\" needs to be set\n");
    }
    return message.toString();
}
 
开发者ID:powsybl,项目名称:powsybl-core,代码行数:67,代码来源:Conductor.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 \"MutualCoupling\" 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\"distance21\" needs to be set\n");
    }

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

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

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

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

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

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

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

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

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


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