Examples of BitSet


Examples of java.util.BitSet

         */
        public boolean isFieldInActualFetchPlan(int fieldNumber)
        {
            if (dirty)
            {
                BitSet fieldsNumber = getFieldsInActualFetchPlanByBitSet();
                return fieldsNumber.get(fieldNumber);
            }
            if (fieldsInActualFetchPlan != null)
            {
                for (int i=0;i<fieldsInActualFetchPlan.length;i++)
                {
View Full Code Here

Examples of java.util.BitSet

        public int[] getFieldsInActualFetchPlan()
        {
            if (dirty)
            {
                dirty = false;
                BitSet fieldsNumber = getFieldsInActualFetchPlanByBitSet();
                int countFieldsInFP = 0;
                for (int i = 0; i < fieldsNumber.length(); i++)
                {
                    if (fieldsNumber.get(i))
                    {
                        countFieldsInFP++;
                    }
                }

                fieldsInActualFetchPlan = new int[countFieldsInFP];
                int nextField = 0;
                for (int i = 0; i < fieldsNumber.length(); i++)
                {
                    if (fieldsNumber.get(i))
                    {
                        fieldsInActualFetchPlan[nextField++] = i;
                    }
                }
            }
View Full Code Here

Examples of java.util.BitSet

         * @param cmd this AbstractClassMetaData
         * @return an BitSet with the bits set in the absolute position of the fields
         */
        private BitSet getFieldsInActualFetchPlanByBitSet(AbstractClassMetaData cmd)
        {
            BitSet bitSet = plan.getFetchPlanForClass(cmd).getFieldsAbsoluteNumber(cmd.getFetchGroupMetaData());
            if (cmd.getPersistenceCapableSuperclass() != null)
            {
                plan.manageFetchPlanForClass(cmd.getSuperAbstractClassMetaData());
                bitSet.or(plan.getFetchPlanForClass(cmd.getSuperAbstractClassMetaData()).getFieldsInActualFetchPlanByBitSet(cmd.getSuperAbstractClassMetaData()));
            }
            else
            {
                // Make sure that we always have the PK fields in the fetch plan = FetchPlanImpl.NONE
                setNoneFieldNumbers(bitSet);
            }

            if (plan.dynamicGroups != null)
            {
                // JPOX dynamic fetch groups extension
                Iterator iter = plan.dynamicGroups.iterator();
                while (iter.hasNext())
                {
                    FetchGroup grp = (FetchGroup)iter.next();
                    if (grp.getClassName().equals(cmd.getFullClassName()))
                    {
                        // Dynamic fetch group applies
                        String[] fields = grp.getFieldNames();
                        for (int i=0;i<fields.length;i++)
                        {
                            int fieldPos = cmd.getAbsolutePositionOfMember(fields[i]);
                            if (fieldPos >= 0)
                            {
                                bitSet.set(fieldPos);
                            }
                        }
                    }
                }
            }
View Full Code Here

Examples of java.util.BitSet

         * @param fgmds The Fetch Groups
         * @return a BitSet with flags set to true in the field number positions
         */
        private BitSet getFieldsAbsoluteNumber(FetchGroupMetaData[] fgmds)
        {
            BitSet fieldsNumber = new BitSet(0);
            if (fgmds != null)
            {
                for (int i = 0; i < fgmds.length; i++)
                {
                    if (plan.groups.contains(fgmds[i].getName()))
                    {
                        fieldsNumber.or(getFieldsAbsoluteNumberInFetchGroup(fgmds[i]));
                    }
                }
            }

            if (plan.groups.contains(FetchPlan.DEFAULT))
View Full Code Here

Examples of java.util.BitSet

         * @param fgmd The Fetch Group
         * @return a list of field numbers
         */
        private BitSet getFieldsAbsoluteNumberInFetchGroup(FetchGroupMetaData fgmd)
        {
            BitSet fieldsNumber = new BitSet(0);
            for (int i = 0; i < fgmd.getMemberMetaData().length; i++)
            {
                int fieldNumber = getFieldNumber(cmd, fgmd.getMemberMetaData()[i].getName());
                if (fieldNumber == -1)
                {
                    throw new JPOXUserException(LOCALISER.msg("006000",
                        fgmd.getMemberMetaData()[i].getName(), fgmd.getName(), cmd.getFullClassName())).setFatal();
                }
                fieldsNumber.set(fieldNumber);
            }
            // fields in nested fetch-groups
            for (int i = 0; i < fgmd.getFetchGroupMetaData().length; i++)
            {
                String nestedGroupName = fgmd.getFetchGroupMetaData()[i].getName();
                if (nestedGroupName.equals(FetchPlan.DEFAULT))
                {
                    setDefaultFieldNumbers(fieldsNumber);
                }
                else if (nestedGroupName.equals(FetchPlan.ALL))
                {
                    setAllFieldNumbers(fieldsNumber);
                }
                else if (nestedGroupName.equals(FetchPlan.NONE))
                {
                    setNoneFieldNumbers(fieldsNumber);
                }
                else
                {
                    FetchGroupMetaData nestedFGMD = getFetchGroupMetaData(cmd,nestedGroupName);
                    if (nestedFGMD == null)
                    {
                        throw new JPOXUserException(LOCALISER.msg("006001",
                            fgmd.getFetchGroupMetaData()[i].getName(), fgmd.getName(), cmd.getFullClassName())).setFatal();
                    }
                    fieldsNumber.or(getFieldsAbsoluteNumberInFetchGroup(nestedFGMD));
                }
            }
            return fieldsNumber;
        }
View Full Code Here

Examples of java.util.BitSet

    @Override
    public void visitJumpInsn(final int opcode, final Label lbl) {
        super.visitJumpInsn(opcode, lbl);
        LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
        if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
            subroutineHeads.put(ln, new BitSet());
        }
    }
View Full Code Here

Examples of java.util.BitSet

            markSubroutines();
            if (LOGGING) {
                log(mainSubroutine.toString());
                Iterator<BitSet> it = subroutineHeads.values().iterator();
                while (it.hasNext()) {
                    BitSet sub = it.next();
                    log(sub.toString());
                }
            }
            emitCode();
        }
View Full Code Here

Examples of java.util.BitSet

    /**
     * Walks the method and determines which internal subroutine(s), if any,
     * each instruction is a method of.
     */
    private void markSubroutines() {
        BitSet anyvisited = new BitSet();

        // First walk the main subroutine and find all those instructions which
        // can be reached without invoking any JSR at all
        markSubroutineWalk(mainSubroutine, 0, anyvisited);

        // Go through the head of each subroutine and find any nodes reachable
        // to that subroutine without following any JSR links.
        for (Iterator<Map.Entry<LabelNode,BitSet>> it = subroutineHeads.entrySet().iterator(); it.hasNext();)
        {
            Map.Entry<LabelNode,BitSet> entry = it.next();
            LabelNode lab = entry.getKey();
            BitSet sub = entry.getValue();
            int index = instructions.indexOf(lab);
            markSubroutineWalk(sub, index, anyvisited);
        }
    }
View Full Code Here

Examples of java.util.BitSet

                            + " is a RET not owned by any subroutine");
                }
                newInstructions.add(new JumpInsnNode(GOTO, retlabel));
            } else if (insn.getOpcode() == JSR) {
                LabelNode lbl = ((JumpInsnNode) insn).label;
                BitSet sub = subroutineHeads.get(lbl);
                Instantiation newinst = new Instantiation(instant, sub);
                LabelNode startlbl = newinst.gotoLabel(lbl);

                if (LOGGING) {
                    log(" Creating instantiation of subr " + sub);
View Full Code Here

Examples of java.util.BitSet

   */
  protected List<Identity> getEventParticipants(KalendarEvent event) {
    List<Identity> identities = new ArrayList<Identity>();
    List<KalendarEvent> lstEvent = new ArrayList<KalendarEvent>();
    lstEvent.add(event);
    BitSet selection = new BitSet(1);
    selection.set(0);
    identities = getSelectedEventParticipants(lstEvent, selection);
    return identities;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.