Android Open Source - permissions Permission Info Comparator






From Project

Back to project page permissions.

License

The source code is released under:

MIT License

If you think the Android project permissions listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.tellmas.android.permissions;
//  ww w  .  j ava  2 s  .  com
import java.util.Comparator;

/**
 * Compares PermissionInfo objects by Permission.name
 *    using the String class's compareTo() method.
 */
public class PermissionInfoComparator implements Comparator<PermissionInfo> {

    /**
     *
     */
    public PermissionInfoComparator() {
        // TODO Auto-generated constructor stub
    }

    /**
     * Compares PermissionInfo objects by PermissionInfo.name
     *
     * @param permInfo1 an PermissionInfo object to compare
     * @param permInfo2 another PermissionInfo object to compare to the first one
     * @return 0 if the PermissionInfo objects have the same name, a negative integer if the first name is alphabetically before the second, or a positive integer if the first name is alphabetically after the second name
     * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
     */
    @Override
    public int compare(PermissionInfo permInfo1, PermissionInfo permInfo2) {
        return permInfo1.getPermission().getName().compareTo(permInfo2.getPermission().getName());
    }

}




Java Source Code List

com.tellmas.android.permissions.AppListExpandableListAdapter.java
com.tellmas.android.permissions.AppListFragment.java
com.tellmas.android.permissions.ApplicationInfoComparator.java
com.tellmas.android.permissions.ApplicationInfo.java
com.tellmas.android.permissions.GlobalDefines.java
com.tellmas.android.permissions.MainActivity.java
com.tellmas.android.permissions.PermListExpandableListAdapter.java
com.tellmas.android.permissions.PermListFragment.java
com.tellmas.android.permissions.PermissionInfoComparator.java
com.tellmas.android.permissions.PermissionInfo.java
com.tellmas.android.permissions.Permission.java