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


Java BitSet.clone方法代码示例

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


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

示例1: removeAt

import java.util.BitSet; //导入方法依赖的package包/类
/** Removes specified amount of bits from the set.
 */
private static BitSet removeAt (BitSet b, int at, int len, int newSize) {
    BitSet clone = (BitSet)b.clone ();
    
    int max = b.length ();
    while (at < max) {
        clone.set (at, b.get (at + len));
        at++;
    }
    clone.set (newSize, b.size (), false);
    return clone;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:LazyListModel.java

示例2: computeImplies

import java.util.BitSet; //导入方法依赖的package包/类
/** Returns the implication of two bit sets */
private BitSet computeImplies(BitSet arg1, BitSet arg2) {
    BitSet result = (BitSet) arg2.clone();
    for (int i = 0; i < this.nodeCount; i++) {
        if (!result.get(i)) {
            result.set(i, arg1.get(i));
        }
    }
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:11,代码来源:CTLMarker.java

示例3: updatePredecessors

import java.util.BitSet; //导入方法依赖的package包/类
protected void updatePredecessors() {
	
	TIntObjectIterator<BitSet> iterator = nodeToSplit.getValue().predecessors.iterator();
	Node<ValueNode> parent = nodeToSplit.getParent();
	BitSet letterToDeleted = new BitSet();
	while(iterator.hasNext()) {
		iterator.advance();
		int letter = iterator.key();
		BitSet statePrevs = iterator.value();
		BitSet stateLeft = (BitSet) statePrevs.clone();
		for(int stateNr = statePrevs.nextSetBit(0)
				; stateNr >= 0
				; stateNr = statePrevs.nextSetBit(stateNr + 1)) {
			ValueNode statePrev = states.get(stateNr);
			Node<ValueNode> nodeOther = sift(statePrev.label.append(letter), parent);
			if (nodeOther != nodeToSplit) {
				updateTransition(stateNr, letter, nodeOther.getValue().id);
				stateLeft.clear(stateNr);
			}
		}
		if(stateLeft.isEmpty()) {
			letterToDeleted.set(letter);
		}else {
			iterator.setValue(stateLeft);
		}
	}
	
	for(int letter = letterToDeleted.nextSetBit(0)
			; letter >= 0
			; letter = letterToDeleted.nextSetBit(letter + 1)) {
		nodeToSplit.getValue().predecessors.remove(letter);
	}
	
}
 
开发者ID:duckly,项目名称:LearnMealyMachine,代码行数:35,代码来源:LearnerTree.java

示例4: create_actions

import java.util.BitSet; //导入方法依赖的package包/类
protected static BitSet create_actions(BitSet actions)
{
	BitSet b;
	b = actions == null ? new BitSet() : (BitSet) actions.clone();
	if (b.isEmpty())
	{
		b.set(PRINT_STATISTICS);
	}
	return b;
}
 
开发者ID:vimerzhao,项目名称:gchisto,代码行数:11,代码来源:GCParserDriver.java

示例5: processBlock

import java.util.BitSet; //导入方法依赖的package包/类
@SuppressWarnings("try")
private void processBlock(AbstractBlockBase<?> block, Deque<AbstractBlockBase<?>> worklist) {
    DebugContext debug = lir.getDebug();
    if (updateOutBlock(block)) {
        try (Indent indent = debug.logAndIndent("handle block %s", block)) {
            ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(block);
            // get out set and mark intervals
            BitSet outSet = liveOutMap.get(block);
            markOutInterval(outSet, getBlockEnd(instructions));
            printLiveSet("liveOut", outSet);

            // process instructions
            BlockClosure closure = new BlockClosure((BitSet) outSet.clone());
            for (int i = instructions.size() - 1; i >= 0; i--) {
                LIRInstruction inst = instructions.get(i);
                closure.processInstructionBottomUp(inst);
            }

            // add predecessors to work list
            for (AbstractBlockBase<?> b : block.getPredecessors()) {
                worklist.add(b);
            }
            // set in set and mark intervals
            BitSet inSet = closure.getCurrentSet();
            liveInMap.put(block, inSet);
            markInInterval(inSet, getBlockBegin(instructions));
            printLiveSet("liveIn", inSet);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:FixPointIntervalBuilder.java

示例6: simplify

import java.util.BitSet; //导入方法依赖的package包/类
private void simplify(LoopRegion loop, BitSet live, int index) {
    List<IRegion> children = loop.getChildren();
    BitSet copy = (BitSet)live.clone();
    for (int i = children.size() - 1; i >= 0; i--) {
        visit(children.get(i), copy);
    }

    if (check(loop, new BitSet(size))) {
        //can simplify
        int startIndex = getFirstBlock(loop);
        BlockNode newBlock = BlockSpiltVisitor.startNewBlock(method, -1);
        MulRegion mulRegion = new MulRegion(newBlock, loop.getParent());
        remover.clear();
        doSimplify(loop, newBlock, mulRegion);
        for (IRegion region : mulRegion.getChildren()) {
            if (region instanceof Region)
                newBlock.getInstructions().add(((Region) region).getInsn().getInstruction());
        }
        method.getMethodData().moveInstructions(startIndex, newBlock.getInstructions());
        method.getMethodData().removeInstructions(remover);
        remover.clear();
        loop.getParent().getChildren().remove(loop);
        loop.getParent().getChildren().add(index, mulRegion);
    } else {
        //can not, simplify children
        for (int i = children.size() - 1; i >= 0; i--) {
            visitLoop(children.get(i), live, i);
        }
    }
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:31,代码来源:TraceLiveVisitor.java

示例7: simplify

import java.util.BitSet; //导入方法依赖的package包/类
private void simplify(LoopRegion loop, BitSet live, int index) {
    List<IRegion> children = loop.getChildren();
    BitSet copy = (BitSet)live.clone();
    for (int i = children.size() - 1; i >= 0; i--) {
        //remove top level insns
        for (IRegion child : children.get(i).getChildren()) {
            if (child instanceof Region)
                ((Region) child).getInsn().add(AFlag.REMOVE_FOR_FLAT);
        }
        visit(children.get(i), copy);
    }

    if (check(loop, new BitSet(size))) {
        //can simplify
        System.out.println("do simplify...");
        int startIndex = getFirstBlock(loop);
        BlockNode newBlock = BlockSpiltVisitor.startNewBlock(method, -1);
        MulRegion mulRegion = new MulRegion(newBlock, loop.getParent());
        remover.clear();
        doSimplify(loop, newBlock, mulRegion);
        for (IRegion region : mulRegion.getChildren()) {
            if (region instanceof Region)
                newBlock.getInstructions().add(((Region) region).getInsn().getInstruction());
        }
        method.getMethodData().moveInstructions(startIndex, newBlock.getInstructions());
        method.getMethodData().removeInstructions(remover);
        remover.clear();
        loop.getParent().getChildren().remove(loop);
        loop.getParent().getChildren().add(index, mulRegion);
    } else {
        //can not, simplify children
        for (int i = children.size() - 1; i >= 0; i--) {
            visitLoop(children.get(i), live, i);
        }
    }
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:37,代码来源:MarkFlattenVisitor.java

示例8: hasTopic

import java.util.BitSet; //导入方法依赖的package包/类
public boolean hasTopic(Topic topic) {
    BitSet m = new BloomFilter(topic).mask;
    BitSet m1 = (BitSet) m.clone();
    m1.and(mask);
    return m1.equals(m);
}
 
开发者ID:talentchain,项目名称:talchain,代码行数:7,代码来源:BloomFilter.java

示例9: computeNeg

import java.util.BitSet; //导入方法依赖的package包/类
/** Returns the negation of a (bit) set. */
private BitSet computeNeg(BitSet arg) {
    BitSet result = (BitSet) arg.clone();
    result.flip(0, this.nodeCount);
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:7,代码来源:CTLMarker.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: computeAnd

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

示例12: intersection

import java.util.BitSet; //导入方法依赖的package包/类
public int intersection(BitSet a, BitSet b) {
	BitSet c = (BitSet)a.clone();
	c.and(b);
	return c.cardinality();
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:6,代码来源:AverageHoursAWeekClassWeights.java

示例13: subset

import java.util.BitSet; //导入方法依赖的package包/类
private static boolean subset(BitSet sub, BitSet sup) {
    BitSet subcopy = (BitSet) sub.clone();
    subcopy.andNot(sup);
    return subcopy.isEmpty();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:DefaultMXBeanMappingFactory.java

示例14: subset

import java.util.BitSet; //导入方法依赖的package包/类
private static boolean subset(BitSet sub, BitSet sup) {
  BitSet subcopy = (BitSet) sub.clone();
  subcopy.andNot(sup);
  return subcopy.isEmpty();
}
 
开发者ID:ampool,项目名称:monarch,代码行数:6,代码来源:OpenTypeConverter.java

示例15: VirtualStackSlotRange

import java.util.BitSet; //导入方法依赖的package包/类
public VirtualStackSlotRange(int id, int slots, BitSet objects, LIRKind kind) {
    super(id, kind);
    this.slots = slots;
    this.objects = (BitSet) objects.clone();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:VirtualStackSlotRange.java


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