当前位置: 首页>>代码示例>>Java>>正文


Java ParseQuery.whereNotEqualTo方法代码示例

本文整理汇总了Java中com.parse.ParseQuery.whereNotEqualTo方法的典型用法代码示例。如果您正苦于以下问题:Java ParseQuery.whereNotEqualTo方法的具体用法?Java ParseQuery.whereNotEqualTo怎么用?Java ParseQuery.whereNotEqualTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.parse.ParseQuery的用法示例。


在下文中一共展示了ParseQuery.whereNotEqualTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllUsers

import com.parse.ParseQuery; //导入方法依赖的package包/类
@NonNull
@Override
public Observable<List<ExampleUser>> getAllUsers(UserQueries.GetAllUsersQuery query) {
    final ParseQuery<ParseUser> parseQuery = new ParseQuery<>("_User");
    parseQuery.whereNotEqualTo("objectId", mParseHelper.getCurrentUser().getObjectId());
    parseQuery.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ONLY);

    return mParseHelper.find(parseQuery)
        .flatMap(Observable::from)
        .map(ParseUtils::fromParseUser)
        .toList()
        .subscribeOn(Schedulers.io());
}
 
开发者ID:badoo,项目名称:Chateau,代码行数:14,代码来源:ParseUserDataSource.java

示例2: Build

import com.parse.ParseQuery; //导入方法依赖的package包/类
public static ParseQuery Build(String className, HashMap[] conditions) {

    ParseQuery<ParseObject> query = new ParseQuery(className);

    // Create a composite query via chaining
    for (int i = 0; i < conditions.length; ++i) {
      HashMap map = conditions[i];

      // These fields must be named exactly the same in the calling application
      String key = (String)map.get("key");
      String condition = (String)map.get("condition");
      Object value = map.get("value");

      if (HasValidConditions(map)) {

        // This sucks, but I don't really want to try to be clever and use
        // reflection to map conditions to method names. It's not by any means
        // a complete implementation, as it only contains condition matching
        // for basic operations.
        if (condition.equals("==")) {
          query = query.whereEqualTo(key, value);
        }
        else if (condition.equals("!=")) {
          query = query.whereNotEqualTo(key, value);
        }
        else if (condition.equals(">")) {
          query = query.whereGreaterThan(key, value);
        }
        else if (condition.equals("<")) {
          query = query.whereLessThan(key, value);
        }
        else if (condition.equals(">=")) {
          query = query.whereGreaterThanOrEqualTo(key, value);
        }
        else if (condition.equals("<=")) {
          query = query.whereLessThanOrEqualTo(key, value);
        }
        else if (condition.equals("exists")) {
          query = query.whereExists(key);
        }
        else if (condition.equals("notexists")) {
          query = query.whereDoesNotExist(key);
        }
        else if (condition.equals("orderby")) {
          if (value.equals("asc")) {
            query = query.orderByAscending(key);
          }
          else if (value.equals("desc")) {
            query = query.orderByDescending(key);
          }
          else {
            Log.e(TAG, "Unrecognized sorting order, use 'asc' or 'desc'.");
          }
        }
        else {
          Log.e(TAG, "The condition '"+ condition + "' was not recognized by " +
          "the module. Create a request for implementation on GitHub, or " +
          "implemented it and create a pull request.");
        }
      }
    }

    return query;
  }
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:65,代码来源:QueryFactory.java

示例3: populateListView

import com.parse.ParseQuery; //导入方法依赖的package包/类
public void populateListView(){
    templist = new ArrayList<ParseObject>();
    listingObjects = new ArrayList<ListingObject>();
    ParseQuery<ParseObject> query = ParseQuery.getQuery("Listing");
    query.whereNotEqualTo("title", " ");
    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(List<ParseObject> parseObjects, ParseException e) {
            if (e == null) {
                Log.d("score", "Retrieved " + parseObjects.size() + " scores");
                templist = parseObjects;
                for(int x = 0; x < parseObjects.size(); x++){
                    ListingObject l = new ListingObject(parseObjects.get(x).getString("title"),parseObjects.get(x).getString("address"),parseObjects.get(x).getString("description"),parseObjects.get(x).getString("creator"),parseObjects.get(x).getString("creatorName"));
                    try {
                        l.setListingType(parseObjects.get(x).getString("serviceType"));
                    }catch(NullPointerException n){

                    }
                    listingObjects.add(l);
                    Log.i("ObjectCreated",new ListingObject(parseObjects.get(x).getString("title"),parseObjects.get(x).getString("address"),parseObjects.get(x).getString("description"),parseObjects.get(x).getString("creator"),parseObjects.get(x).getString("creatorName")).toString());
                    listingAdapter = new ListingAdapter(getApplicationContext(),listingObjects);
                    listview = (ListView)findViewById(R.id.lists);
                    listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                        @Override
                        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                            ListingObject myobj = listingAdapter.getItem(position);
                            String name = myobj.getTitle();
                            String ad = myobj.getAddress();
                            String des = myobj.getDescription();
                            Intent myIntent = new Intent(getApplicationContext(),ListingActivity.class);
                            myIntent.putExtra("title",name);
                            myIntent.putExtra("address",ad);
                            myIntent.putExtra("description",des);
                            myIntent.putExtra("creator",myobj.getCreator());
                            myIntent.putExtra("creatorName",myobj.getCreatorName());
                            Log.d("CreatorName",myobj.getCreatorName());
                            startActivity(myIntent);
                        }
                    });
                    listview.setAdapter(listingAdapter);
                }
            } else {
                Log.d("score", "Error: " + e.getMessage());
            }

        }
    });
    Log.i("Listview",listingObjects.toString());

}
 
开发者ID:hackathoner,项目名称:Barter,代码行数:51,代码来源:HomePage.java

示例4: recommendPeople

import com.parse.ParseQuery; //导入方法依赖的package包/类
public void recommendPeople(){

        if(currentUser.get("City").toString() != "Blank") {
            users = new ArrayList<>();
            ParseQuery<ParseUser> query = ParseUser.getQuery();
            query.whereNotEqualTo("username", currentUser.getUsername().toString());
            query.findInBackground(new FindCallback<ParseUser>() {
                public void done(List<ParseUser> objects, ParseException e) {
                    if (e == null) {
                        Log.e("Discovery", objects.toString());
                        calculateWeight((ArrayList<ParseUser>) objects);
                        ArrayList<ParseUser> parseUserDB = weightedUsers;
                        //pass the data into discovery user array list
                        for (int i = 0; i < parseUserDB.size(); i++) {
                            ParseUser tmpUser = parseUserDB.get(i);
                            String username = tmpUser.getUsername();
                            String gender = tmpUser.get("Gender").toString();
                            String location = tmpUser.get("City").toString();
                            ParseFile imageFile = (ParseFile) tmpUser.get("Image");
                            Bitmap profileImage;
                            if (imageFile != null) {
                                byte[] bitmapdata = new byte[0];
                                try {
                                    bitmapdata = imageFile.getData();
                                } catch (ParseException eg) {
                                    eg.printStackTrace();
                                }
                                Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapdata, 0, bitmapdata.length);
                                profileImage = bitmap;
                            } else {
                                Drawable myDrawable = getResources().getDrawable(R.drawable.default_profile_image);
                                Bitmap defaultImage = ((BitmapDrawable) myDrawable).getBitmap();
                                profileImage = defaultImage;
                            }
                            DiscoverUser discoverUser = new DiscoverUser();
                            discoverUser.setProfileImage(profileImage);
                            discoverUser.setUsername(username);
                            discoverUser.setGender(gender);
                            discoverUser.setLocation(location);
                            if(!currentUser.getUsername().equals(discoverUser.getUsername())) {
                                users.add(discoverUser);
                            }
                        }
                        discoveryAdapter.setUsers(users);
                        discoveryAdapter.notifyDataSetChanged();
                    } else {
                        // Something went wrong.
                        Log.e("Discovery", "Exception thrown");
                    }
                }
            });
        }
    }
 
开发者ID:CarlXue,项目名称:COMP90018,代码行数:54,代码来源:DiscoveryFragment.java

示例5: onCreate

import com.parse.ParseQuery; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_list);

    usernames = new ArrayList<String>();
    listView = (ListView) findViewById(R.id.listView);

    arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, usernames);
    listView.setAdapter(arrayAdapter);

    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            startActivityForResult(i, position);

        }
    });

    ParseQuery<ParseUser> query = ParseUser.getQuery();

    Log.i("asdf", ParseUser.getCurrentUser().getUsername());

    query.whereNotEqualTo("username", ParseUser.getCurrentUser().getUsername());
    query.findInBackground(new FindCallback<ParseUser>() {
        public void done(List<ParseUser> objects, ParseException e) {
            if (e == null) {

                if (objects.size() > 0) {

                    usernames.clear();

                    for (ParseUser user : objects) {

                        usernames.add(user.getUsername());

                    }

                    arrayAdapter.notifyDataSetChanged();

                }


            } else {
                // Something went wrong.
            }
        }
    });

    checkForImages();


}
 
开发者ID:angeshpokharel,项目名称:Snapchat-parse,代码行数:56,代码来源:UserList.java


注:本文中的com.parse.ParseQuery.whereNotEqualTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。