Package java.util

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


    @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

            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

    /**
     * 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

                            + " 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

   */
  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

      }
    } else if(source == editChecklistTable) {
      if(event instanceof TableMultiSelectEvent) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent)event;
        if(tmse.getAction().equals("save")) {
          BitSet selection = tmse.getSelection();
          updateCheckpointsFor(selectedIdentity, selection);
          initManageTable(ureq);
        }
        cmc.deactivate();
      }
View Full Code Here

          CloseableModalController manageParticipantsModalCntrl = new CloseableModalController(getWindowControl(), "close", participantsVC, true, translate("dates.table.participant.manage"));
          manageParticipantsModalCntrl.activate();
        }
      } else {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent)event;
        BitSet selection = tmse.getSelection();
        //delete all users from the selected dates
        if(tmse.getAction().equals(DENListTableDataModel.DELETE_ACTION) && selection.cardinality() > 0) {
          removed = denManager.getSelectedEventParticipants(dateList, selection);
          dateList = denManager.deleteParticipants(ores, courseNode, denManager.getSelectedEventIDs(dateList, selection));
          listTableData.setObjects(dateList);
          //send notification mail
          createRemovedNotificationMail(ureq, dateList.get(0).getSubject());
        } else if(tmse.getAction().equals(DENListTableDataModel.MAIL_ACTION) && selection.cardinality() > 0) {
          //send email to all users from the selected dates
          List<Identity> participants = denManager.getSelectedEventParticipants(dateList, selection);
          createParticipantsMail(ureq, participants);
        } else if(selection.cardinality() == 0) {
          getWindowControl().setWarning(translate("participants.message.empty"));
        }
      }
    } else if(source == formManageParticipants && event == DENManageParticipantsForm.ADD_PARTICIPANTS) {
      //open user search controller to manually add users in date
View Full Code Here

        }
        else if ((flags&FLAG_RETRIEVING_DETACHED_STATE)!=0)
        {
            // Retrieving the detached state from the detached object
            // Don't need the id or version since they can't change
            BitSet jdoLoadedFields = (BitSet)currentState[2];
            for (int i = 0; i < this.loadedFields.length; i++)
            {
                this.loadedFields[i] = jdoLoadedFields.get(i);
            }

            BitSet jdoModifiedFields = (BitSet)currentState[3];
            for (int i = 0; i < dirtyFields.length; i++)
            {
                dirtyFields[i] = jdoModifiedFields.get(i);
            }
            setVersion(currentState[1]);
            return currentState;
        }
        else
        {
            // Updating the detached state in the detached object with our state
            Object[] state = new Object[4];
            state[0] = myID;
            state[1] = getVersion(myPC);

            // Loaded fields
            BitSet loadedState = new BitSet();
            for (int i = 0; i < loadedFields.length; i++)
            {
                if (loadedFields[i])
                {
                    loadedState.set(i);
                }
                else
                {
                    loadedState.clear(i);
                }
            }
            state[2] = loadedState;

            // Modified fields
            BitSet modifiedState = new BitSet();
            for (int i = 0; i < dirtyFields.length; i++)
            {
                if (dirtyFields[i])
                {
                    modifiedState.set(i);
                }
                else
                {
                    modifiedState.clear(i);
                }
            }
            state[3] = modifiedState;

            return state;
View Full Code Here

  public CollisionMap(final int width, final int height) {
    this.width = width;
    this.height = height;
    colls = new BitSet[width];
    for (int i = 0; i < width; i++) {
      colls[i] = new BitSet();
    }

  }
View Full Code Here

TOP

Related Classes of java.util.BitSet

Copyright © 2018 www.massapicom. 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.