Examples of NSSet


Examples of com.webobjects.foundation.NSSet

        list.add(value);
      }
      result = list;
    } else if (obj instanceof NSSet) {
      Set set = new HashSet();
      NSSet nsSet = (NSSet) obj;
      Enumeration valuesEnum = nsSet.objectEnumerator();
      while (valuesEnum.hasMoreElements()) {
        Object value = valuesEnum.nextElement();
        value = toJavaCollections(value);
        set.add(value);
      }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

        list.add(value);
      }
      result = list;
    } else if (obj instanceof NSSet) {
      Set set = new HashSet();
      NSSet nsSet = (NSSet) obj;
      Enumeration valuesEnum = nsSet.objectEnumerator();
      while (valuesEnum.hasMoreElements()) {
        Object value = valuesEnum.nextElement();
        value = toJavaCollections(value);
        set.add(value);
      }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

    }
  }

  public Object marshall(SerializerState state, Object p, Object o) throws MarshallException {
    try {
      NSSet set = (NSSet) o;

      JSONObject obj = new JSONObject();
      JSONObject setdata = new JSONObject();
      obj.put("javaClass", o.getClass().getName());
      obj.put("set", setdata);
      String key = null;
      try {
        int index = 0;
        Enumeration i = set.objectEnumerator();
        while (i.hasMoreElements()) {
          Object value = i.nextElement();
          setdata.put(key, ser.marshall(state, o, value, Integer.valueOf(index)));
          index++;
        }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

        // update our selection, so that we don't have any objects selected that are not visible on any page
        if ( selectedObjects().count() > 0 && filteredObjects().count() > 0 ) {
            // once intersectingElements() is more efficient, we can use that
            //int preIntersectCount = selectedObjects().count();
            //NSArray newSelection = ERXArrayUtilities.intersectingElements(selectedObjects(), filteredObjects());           
            NSSet selectedSet = new NSSet (selectedObjects());
            NSSet filteredSet = new NSSet (filteredObjects());
            int preIntersectCount = selectedSet.count();
            NSSet newSelection = selectedSet.setByIntersectingSet(filteredSet);
            if (newSelection.count() != preIntersectCount) {
                setSelectedObjects(newSelection.allObjects());
            }
        }
    }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

         gidful.addObject(ERXEOControlUtilities.convertEOtoGID(objEnum.nextElement()));
       }
       result = gidful;
     }
     else if (obj instanceof NSSet) {
       NSSet eoful = (NSSet)obj;
       NSMutableSet gidful = new NSMutableSet();
       Enumeration objEnum = eoful.objectEnumerator();
       while (objEnum.hasMoreElements()) {
         gidful.addObject(ERXEOControlUtilities.convertEOtoGID(objEnum.nextElement()));
       }
       result = gidful;
     }
     else if (obj instanceof NSDictionary) {
       NSDictionary eoful = (NSDictionary)obj;
       NSMutableDictionary gidful = new NSMutableDictionary();
       Enumeration keyEnum = eoful.keyEnumerator();
       while (keyEnum.hasMoreElements()) {
         Object eofulKey = keyEnum.nextElement();
         Object gidfulKey = ERXEOControlUtilities.convertEOtoGID(eofulKey);
         Object gidfulValue = ERXEOControlUtilities.convertEOtoGID(eoful.objectForKey(eofulKey));
         gidful.setObjectForKey(gidfulValue, gidfulKey);
       }
       result = gidful;
     }
     else {
View Full Code Here

Examples of com.webobjects.foundation.NSSet

         }
         result = eoful;
       }
     }
     else if (obj instanceof NSSet) {
       NSSet gidful = (NSSet)obj;
       boolean allGIDs = true;
       Enumeration objEnum = gidful.objectEnumerator();
       while (allGIDs && objEnum.hasMoreElements()) {
         allGIDs = (objEnum.nextElement() instanceof EOGlobalID);
       }
       if (allGIDs) {
         result = new NSSet(ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gidful.allObjects()));
       }
       else {
         NSMutableSet eoful = new NSMutableSet();
         objEnum = gidful.objectEnumerator();
         while (objEnum.hasMoreElements()) {
           eoful.addObject(ERXEOControlUtilities.convertGIDtoEO(editingContext, objEnum.nextElement()));
         }
         result = eoful;
       }
     }
     else if (obj instanceof NSDictionary) {
       NSDictionary gidful = (NSDictionary)obj;
       NSMutableDictionary eoful = new NSMutableDictionary();
       Enumeration keyEnum = gidful.keyEnumerator();
       while (keyEnum.hasMoreElements()) {
         Object gidfulKey = keyEnum.nextElement();
         Object eofulKey = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidfulKey);
         Object eofulValue = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidful.objectForKey(gidfulKey));
         eoful.setObjectForKey(eofulValue, eofulKey);
       }
       result = eoful;
     }
     else {
View Full Code Here

Examples of com.webobjects.foundation.NSSet

    protected void addInstancesForApplication(MApplication mapplication) {
        instances.addObjectsFromArray(mapplication.instanceArray());
    }

    protected void refreshInformation() {
        for (Enumeration enumeration = (new NSSet((NSArray) instances.valueForKey("application"))).objectEnumerator(); enumeration.hasMoreElements();) {
            MApplication mapplication = (MApplication) enumeration.nextElement();
           
            @SuppressWarnings("unused")
            AppDetailPage dummy = AppDetailPage.create(context(), mapplication);
        }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

   *            default value if object is null
   * @return NSSet evaluation of the given object
   *
   */
  public static NSSet setValueWithDefault(Object obj, NSSet def) {
    NSSet value = def;
    if (!ERXValueUtilities.isNull(obj)) {
      if (obj instanceof NSSet) {
        value = (NSSet) obj;
      } else if (obj instanceof NSArray) {
        value = new NSSet((NSArray) obj);
      } else if (obj instanceof String) {
        NSArray array = arrayValueWithDefault(obj, null);
        if (array != null) {
          value = new NSSet(array);
        }
      } else {
        throw new IllegalArgumentException("Failed to parse a set from the value '" + obj + "'.");
      }
    }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

    NSSet<String> nsset = new NSSet<String>(eomodel.entityNames());
    while (enumeration.hasMoreElements()) {
      EOModel eomodel1 = (EOModel) enumeration.nextElement();
      nsmutableset.addObjectsFromArray(eomodel1.entityNames());
    }
    NSSet intersection = nsmutableset.setByIntersectingSet(nsset);
    if (intersection.count() != 0) {
      log.warn("The model '" + name + "' (path: " + eomodel.pathURL() + ") has an entity name conflict with the entities " + intersection + " already in the model group " + this);
      Enumeration e = intersection.objectEnumerator();
      while (e.hasMoreElements()) {
        String entityName = (String) e.nextElement();
        log.debug("Removing entity " + entityName + " from model " + name);
        eomodel.removeEntity(eomodel.entityNamed(entityName));
      }
View Full Code Here

Examples of com.webobjects.foundation.NSSet

        return null;
    }
    public NSArray modelKeys() {
        Class c = ERXArrayUtilities.class;
        NSArray keys = (NSArray)model.publicRules().valueForKey("rhsKeyPath");
        keys = (NSArray)(new NSSet(keys).allObjects().valueForKey("@sort.toString"));
        return keys;
    }
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.