Package cross.reputation.model

Examples of cross.reputation.model.Entity$GroupEntity


        for(int i = 0; i < size; i++){
          JSONObject object = array.getJSONObject(i);
          String name = object.names().getString(0);
          JSONArray array_object = object.getJSONArray(name);
          int arraySize = array_object.size();
          Entity entity = new Entity(name);
         
        for(int j = 0; j < arraySize; j++){
              String user = array_object.getJSONObject(j).names().getString(0);

          if(user.equalsIgnoreCase("not_exist")) {
            notExistantUser.add(name);
            continue;
          }
          try{
            Double value = Double.parseDouble(user);
            userPredefined.add(new Ent_Eva(new Entity(name),value));
            continue;
           
          }catch (Exception e) {}
         
          JSONArray userArray = array_object.getJSONObject(j).getJSONArray(user);
          String domain = findDomain(userArray.getString(0));
        if(domain == null) {
          System.out.println("Error: domain is not known from user "+
          entity.getUniqueIdentificator()+" and it is discarted:"+ userArray.getString(0));
          continue;
        }
        if(!name.equals("")){
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
            new EntityIdentifier(user,null));
        }
        else{
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
            new EntityIdentifier(entity.getUniqueIdentificator(),userArray.getString(0)));
        }
         
        if(!entity.getIdentificatorInCommunities().isEmpty()) {
          GlobalModel.addEntity(entity);
        }
         
        }
View Full Code Here


        contents[1] = line.substring(line.indexOf(":")+1);
        //System.out.println("line:"+contents[1]);
      }
      try {
        Double value = Double.parseDouble(contents[1]);
        userPredefined.add(new Ent_Eva(new Entity(contents[0]),value));
        continue;
      } catch (Exception e) {}
      Entity entity = new Entity(contents[0]);
      contents = contents[1].split(",");
      for(int i = 0; i < contents.length; i++) {
        int coincidence = contents[i].indexOf("^#^");
        if(coincidence == -1) {
          String domain = findDomain(contents[i]);
          if(domain == null) {
            System.out.println("Error: domain is not known from user:"+
            entity.getUniqueIdentificator()+" and it is discarted: "+contents[i]);
            continue;
          }
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
              new EntityIdentifier(entity.getUniqueIdentificator(),contents[i]));
        } else {
          String userName = contents[i].substring(0,coincidence);
          //System.out.println("iu:"+entity.getUniqueIdentificator()+",u:"+userName);
          String domain = findDomain(contents[i].substring(coincidence+3));
          //System.out.println("d:"+domain);         
          if(domain == null) {
            System.out.println("Error: domain is not known from user:"+
                entity.getUniqueIdentificator()+"-nickname:"+userName+
                " and it is discarted: "+contents[i].substring(coincidence+3));
            continue;
          }
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
              new EntityIdentifier(userName,null));
        }         
      }
      if(!entity.getIdentificatorInCommunities().isEmpty()) {
        GlobalModel.addEntity(entity);
      }
    }
    reader.close();
    ConfigureModel.GetMoreAccounts();
View Full Code Here

TOP

Related Classes of cross.reputation.model.Entity$GroupEntity

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.