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


Java NameFileComparator.NAME_INSENSITIVE_COMPARATOR属性代码示例

本文整理汇总了Java中org.apache.commons.io.comparator.NameFileComparator.NAME_INSENSITIVE_COMPARATOR属性的典型用法代码示例。如果您正苦于以下问题:Java NameFileComparator.NAME_INSENSITIVE_COMPARATOR属性的具体用法?Java NameFileComparator.NAME_INSENSITIVE_COMPARATOR怎么用?Java NameFileComparator.NAME_INSENSITIVE_COMPARATOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.io.comparator.NameFileComparator的用法示例。


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

示例1: FileAlterationObserver

/**
 * Construct an observer for the specified directory, file filter and
 * file comparator.
 *
 * @param rootEntry the root directory to observe
 * @param fileFilter The file filter or null if none
 * @param caseSensitivity  what case sensitivity to use comparing file names, null means system sensitive
 */
protected FileAlterationObserver(FileEntry rootEntry, FileFilter fileFilter, IOCase caseSensitivity) {
    if (rootEntry == null) {
        throw new IllegalArgumentException("Root entry is missing");
    }
    if (rootEntry.getFile() == null) {
        throw new IllegalArgumentException("Root directory is missing");
    }
    this.rootEntry = rootEntry;
    this.fileFilter = fileFilter;
    if (caseSensitivity == null || caseSensitivity.equals(IOCase.SYSTEM)) {
        this.comparator = NameFileComparator.NAME_SYSTEM_COMPARATOR;
    } else if (caseSensitivity.equals(IOCase.INSENSITIVE)) {
        this.comparator = NameFileComparator.NAME_INSENSITIVE_COMPARATOR;
    } else {
        this.comparator = NameFileComparator.NAME_COMPARATOR;
    }
}
 
开发者ID:fesch,项目名称:Moenagade,代码行数:25,代码来源:FileAlterationObserver.java

示例2: FileAlterationObserver

/**
 * Construct an observer for the specified directory, file filter and
 * file comparator.
 *
 * @param rootEntry the root directory to observe
 * @param fileFilter The file filter or null if none
 * @param caseSensitivity  what case sensitivity to use comparing file names, null means system sensitive
 */
protected FileAlterationObserver(final FileEntry rootEntry, final FileFilter fileFilter,
                                 final IOCase caseSensitivity) {
    if (rootEntry == null) {
        throw new IllegalArgumentException("Root entry is missing");
    }
    if (rootEntry.getFile() == null) {
        throw new IllegalArgumentException("Root directory is missing");
    }
    this.rootEntry = rootEntry;
    this.fileFilter = fileFilter;
    if (caseSensitivity == null || caseSensitivity.equals(IOCase.SYSTEM)) {
        this.comparator = NameFileComparator.NAME_SYSTEM_COMPARATOR;
    } else if (caseSensitivity.equals(IOCase.INSENSITIVE)) {
        this.comparator = NameFileComparator.NAME_INSENSITIVE_COMPARATOR;
    } else {
        this.comparator = NameFileComparator.NAME_COMPARATOR;
    }
}
 
开发者ID:PuppyRush,项目名称:WidgetStore,代码行数:26,代码来源:FileAlterationObserver.java

示例3: FileAlterationObserver

/**
 * Construct an observer for the specified directory, file filter and
 * file comparator.
 *
 * @param rootEntry the root directory to observe
 * @param fileFilter The file filter or null if none
 * @param caseSensitivity  what case sensitivity to use comparing file names, null means system sensitive
 */
protected FileAlterationObserver(FileEntry rootEntry, FileFilter fileFilter, IOCase caseSensitivity, boolean circulate) {
    if (rootEntry == null) {
        throw new IllegalArgumentException("Root entry is missing");
    }
    if (rootEntry.getFile() == null) {
        throw new IllegalArgumentException("Root directory is missing");
    }
    this.rootEntry = rootEntry;
    this.fileFilter = fileFilter;
    this.circulate = circulate;
    if (caseSensitivity == null || caseSensitivity.equals(IOCase.SYSTEM)) {
        this.comparator = NameFileComparator.NAME_SYSTEM_COMPARATOR;
    } else if (caseSensitivity.equals(IOCase.INSENSITIVE)) {
        this.comparator = NameFileComparator.NAME_INSENSITIVE_COMPARATOR;
    } else {
        this.comparator = NameFileComparator.NAME_COMPARATOR;
    }
}
 
开发者ID:Jakegogo,项目名称:concurrent,代码行数:26,代码来源:FileAlterationObserver.java

示例4: convertSortOrder

protected Comparator<File> convertSortOrder()
{
    Comparator<File> result = NameFileComparator.NAME_COMPARATOR;
    if ( getSortOrder().equalsIgnoreCase( "NAME_INSENSITIVE_COMPARATOR" ) )
    {
        result = NameFileComparator.NAME_INSENSITIVE_COMPARATOR;
    }
    else if ( getSortOrder().equalsIgnoreCase( "NAME_INSENSITIVE_REVERSE" ) )
    {
        result = NameFileComparator.NAME_INSENSITIVE_REVERSE;
    }
    else if ( getSortOrder().equalsIgnoreCase( "NAME_REVERSE" ) )
    {
        result = NameFileComparator.NAME_REVERSE;
    }
    else if ( getSortOrder().equalsIgnoreCase( "NAME_SYSTEM_COMPARATOR" ) )
    {
        result = NameFileComparator.NAME_SYSTEM_COMPARATOR;
    }
    else if ( getSortOrder().equalsIgnoreCase( "NAME_SYSTEM_REVERSE" ) )
    {
        result = NameFileComparator.NAME_SYSTEM_REVERSE;
    }
    return result;
}
 
开发者ID:khmarbaise,项目名称:iterator-maven-plugin,代码行数:25,代码来源:AbstractIteratorMojo.java

示例5: getFilesItemsInCurrentDirectory

public ArrayList<FileItem> getFilesItemsInCurrentDirectory() {
    Operations op = Operations.getInstance(mContext);
    Constants.SORT_OPTIONS option = op.getmCurrentSortOption();
    Constants.FILTER_OPTIONS filterOption = op.getmCurrentFilterOption();
    if (mFileNavigator.getmCurrentNode() == null) mFileNavigator.setmCurrentNode(mFileNavigator.getmRootNode());
    File[] files = mFileNavigator.getFilesInCurrentDirectory();
    if (files != null) {
        mFiles.clear();
        Comparator<File> comparator = NameFileComparator.NAME_INSENSITIVE_COMPARATOR;
        switch(option) {
            case SIZE:
                comparator = SizeFileComparator.SIZE_COMPARATOR;
                break;
            case LAST_MODIFIED:
                comparator = LastModifiedFileComparator.LASTMODIFIED_COMPARATOR;
                break;
        }
        Arrays.sort(files,comparator);
        for (int i = 0; i < files.length; i++) {
            boolean addToFilter = true;
            switch(filterOption) {
                case FILES:
                    addToFilter = !files[i].isDirectory();
                    break;
                case FOLDER:
                    addToFilter = files[i].isDirectory();
                    break;
            }
            if (addToFilter)
                mFiles.add(new FileItem(files[i]));
        }
    }
    return mFiles;
}
 
开发者ID:adityak368,项目名称:Android-FileBrowser-FilePicker,代码行数:34,代码来源:NavigationHelper.java


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