Examples of Collection


Examples of java.util.Collection

   *
   * @return An Integer Array of unique Group IDs.
   */
  public Integer[] getGroupIDs()
  {
    Collection groupIDs = new ArrayList();
    if (this.searchCriteria != null)
    {
      Iterator it = this.searchCriteria.iterator();
      while (it.hasNext())
      {
        SearchCriteriaVO searchCriteriaVO = (SearchCriteriaVO) it.next();
        if (!groupIDs.contains(new Integer(searchCriteriaVO.getGroupID())))
        {
          groupIDs.add(new Integer(searchCriteriaVO.getGroupID()));
        } //end of if statement (!groupIDs.contains(...
      } //end of while loop (iterator.hasNext())
    } //end of if statement (this.searchCriteria != null)
    return (Integer[]) groupIDs.toArray(new Integer[groupIDs.size()]);
  } //end of getGroupIDs method
View Full Code Here

Examples of java.util.Collection

    handler.setTargetBeanExpression(null);
    handler.setBeanPropertyName("domainClass");
    handler.setBeanPropertyClass(Integer.class);

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
View Full Code Here

Examples of java.util.Collection

  @Test
  public void testNullTargetBindOutwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    // form.setTargetBean(targetBean);
View Full Code Here

Examples of java.util.Collection

  @Test
  public void testTargetBindInwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
View Full Code Here

Examples of java.util.Collection

  @Test
  public void testNullTargetBindInwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    // form.setTargetBean(targetBean);
View Full Code Here

Examples of java.util.Collection

  @Test
  public void testInvalidIdBindInwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
View Full Code Here

Examples of java.util.Collection

  {

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));

    Map map = handler.createMap(collection);
    assert map instanceof HashMap;

    Object firstKey = map.keySet().iterator().next();
View Full Code Here

Examples of java.util.Collection

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    // create domain class instances with no id
    Collection collection = new ArrayList();
    collection.add(new DomainClass());
    collection.add(new DomainClass());
    collection.add(new DomainClass());

    Map map = handler.createMap(collection);
    assert map.size() == 1;
    assert map.keySet().iterator().next().equals(0);
  }
View Full Code Here

Examples of java.util.Collection

  {

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);

    assert map.size() == 3;
    assert map instanceof HashMap;
View Full Code Here

Examples of java.util.Collection

      Vector vecView = new Vector();
      Vector vecAll = new Vector();
      Vector vecSchedule = new Vector();
      Vector vecSend = new Vector();

      Collection colview = new ArrayList();
      Collection colAll = new ArrayList();
      Collection colschedule = new ArrayList();
      Collection colsend = new ArrayList();

      String typeofModule = "";

      HttpSession session = request.getSession(true);
      com.centraview.common.UserObject userobjectd = (com.centraview.common.UserObject)session.getAttribute("userobject"); //get the user object
      int individualId = userobjectd.getIndividualID();

      ListGenerator lg = ListGenerator.getListGenerator(dataSource);

      String moduleName = "";
      typeofModule = (String)request.getParameter("TYPEOFMODULE");

      if (typeofModule == null) {
        typeofModule = (String)request.getAttribute("TYPEOFMODULE");
      }
      if (typeofModule == null) {
          typeofModule = Constants.EMAILMODULE;
      }     

      if (typeofModule != null) {
        if (typeofModule.equals(Constants.ACTIVITYMODULE)) {
          moduleName = Constants.ACTIVITYMODULE;
        } else if (typeofModule.equals(Constants.EMAILMODULE)) {
          moduleName = Constants.EMAILMODULE;
        }
      }
     
      PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
      Preference prefRemote = (Preference)prefHome.create();
      prefRemote.setDataSource(dataSource);
     
      if (moduleName.equals(Constants.ACTIVITYMODULE)) {
      hm = prefRemote.getUserDelegation(individualId, moduleName);
        vecView = (Vector)hm.get(Constants.VIEW);
        vecSchedule = (Vector)hm.get(Constants.SCHEDULEACTIVITY);
        vecAll = (Vector)hm.get(Constants.VIEWSCHEDULEACTIVITY);
      } else if (moduleName.equals(Constants.EMAILMODULE)) {
      Vector emailVecSend = prefRemote.getEmailDelegation(individualId);
        vecView = (Vector)hm.get(Constants.VIEW);
        vecSend = emailVecSend;
        vecAll = (Vector)hm.get(Constants.VIEWSENDEMAIL);
      }

      ContactFacadeHome facadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade cfremote = (ContactFacade) facadeHome.create();
      cfremote.setDataSource(dataSource);

      // get the records from the database
      Collection sqlResults = cfremote.getEmployeeListCollection(individualId);

      // now create a DisplayList out of those records
      IndividualList employeeList = new IndividualList();

      // ok, now that we have the results from the database,
      // we need to generate a DisplayList object to pass
      // to the List View code (List.jsp)
      Iterator iter = sqlResults.iterator();

      while (iter.hasNext()) {
        HashMap sqlRow = (HashMap)iter.next();

        String individualName = (String)sqlRow.get("Name");
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.