Java Code Examples for com.android.io.IAbstractFolder#equals()

The following examples show how to use com.android.io.IAbstractFolder#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResourceRepository.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the {@link ResourceFolder} associated with a {@link IAbstractFolder}.
 * @param folder The {@link IAbstractFolder} object.
 * @return the {@link ResourceFolder} or null if it was not found.
 */
@Nullable
public ResourceFolder getResourceFolder(@NonNull IAbstractFolder folder) {
    ensureInitialized();

    Collection<List<ResourceFolder>> values = mFolderMap.values();

    for (List<ResourceFolder> list : values) {
        for (ResourceFolder resFolder : list) {
            IAbstractFolder wrapper = resFolder.getFolder();
            if (wrapper.equals(folder)) {
                return resFolder;
            }
        }
    }

    return null;
}
 
Example 2
Source File: ResourceRepository.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the {@link ResourceFolder} associated with a {@link IAbstractFolder}.
 * @param folder The {@link IAbstractFolder} object.
 * @return the {@link ResourceFolder} or null if it was not found.
 */
@Nullable
public ResourceFolder getResourceFolder(@NonNull IAbstractFolder folder) {
    ensureInitialized();

    Collection<List<ResourceFolder>> values = mFolderMap.values();

    for (List<ResourceFolder> list : values) {
        for (ResourceFolder resFolder : list) {
            IAbstractFolder wrapper = resFolder.getFolder();
            if (wrapper.equals(folder)) {
                return resFolder;
            }
        }
    }

    return null;
}
 
Example 3
Source File: ResourceRepository.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the {@link ResourceFolder} associated with a {@link IAbstractFolder}.
 * @param folder The {@link IAbstractFolder} object.
 * @return the {@link ResourceFolder} or null if it was not found.
 */
@Nullable
public ResourceFolder getResourceFolder(@NonNull IAbstractFolder folder) {
    ensureInitialized();

    Collection<List<ResourceFolder>> values = mFolderMap.values();

    for (List<ResourceFolder> list : values) {
        for (ResourceFolder resFolder : list) {
            IAbstractFolder wrapper = resFolder.getFolder();
            if (wrapper.equals(folder)) {
                return resFolder;
            }
        }
    }

    return null;
}
 
Example 4
Source File: ResourceRepository.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Removes a {@link ResourceFolder} associated with the specified {@link IAbstractFolder}.
 * @param type The type of the folder
 * @param removedFolder the IAbstractFolder object.
 * @param context the scanning context
 * @return the {@link ResourceFolder} that was removed, or null if no matches were found.
 */
@Nullable
public ResourceFolder removeFolder(
        @NonNull ResourceFolderType type,
        @NonNull IAbstractFolder removedFolder,
        @Nullable ScanningContext context) {
    ensureInitialized();

    // get the list of folders for the resource type.
    List<ResourceFolder> list = mFolderMap.get(type);

    if (list != null) {
        int count = list.size();
        for (int i = 0 ; i < count ; i++) {
            ResourceFolder resFolder = list.get(i);
            IAbstractFolder folder = resFolder.getFolder();
            if (removedFolder.equals(folder)) {
                // we found the matching ResourceFolder. we need to remove it.
                list.remove(i);

                // remove its content
                resFolder.dispose(context);

                return resFolder;
            }
        }
    }

    return null;
}
 
Example 5
Source File: ResourceRepository.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Removes a {@link ResourceFolder} associated with the specified {@link IAbstractFolder}.
 * @param type The type of the folder
 * @param removedFolder the IAbstractFolder object.
 * @param context the scanning context
 * @return the {@link ResourceFolder} that was removed, or null if no matches were found.
 */
@Nullable
public ResourceFolder removeFolder(
        @NonNull ResourceFolderType type,
        @NonNull IAbstractFolder removedFolder,
        @Nullable ScanningContext context) {
    ensureInitialized();

    // get the list of folders for the resource type.
    List<ResourceFolder> list = mFolderMap.get(type);

    if (list != null) {
        int count = list.size();
        for (int i = 0 ; i < count ; i++) {
            ResourceFolder resFolder = list.get(i);
            IAbstractFolder folder = resFolder.getFolder();
            if (removedFolder.equals(folder)) {
                // we found the matching ResourceFolder. we need to remove it.
                list.remove(i);

                // remove its content
                resFolder.dispose(context);

                return resFolder;
            }
        }
    }

    return null;
}
 
Example 6
Source File: ResourceRepository.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
/**
 * Removes a {@link ResourceFolder} associated with the specified {@link IAbstractFolder}.
 *
 * @param type The type of the folder
 * @param removedFolder the IAbstractFolder object.
 * @param context the scanning context
 * @return the {@link ResourceFolder} that was removed, or null if no matches were found.
 */
@Nullable
public ResourceFolder removeFolder(
        @NonNull ResourceFolderType type,
        @NonNull IAbstractFolder removedFolder,
        @Nullable ScanningContext context) {
    ensureInitialized();

    // get the list of folders for the resource type.
    List<ResourceFolder> list = mFolderMap.get(type);

    if (list != null) {
        int count = list.size();
        for (int i = 0 ; i < count ; i++) {
            ResourceFolder resFolder = list.get(i);
            IAbstractFolder folder = resFolder.getFolder();
            if (removedFolder.equals(folder)) {
                // we found the matching ResourceFolder. we need to remove it.
                list.remove(i);

                // remove its content
                resFolder.dispose(context);

                return resFolder;
            }
        }
    }

    return null;
}