⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 duplicateimagefilecomparitor.java

📁 java开发的 图片比较程序
💻 JAVA
字号:
package filelogic.comparitors;

import java.io.File;
import java.io.IOException;
import java.util.Vector;

public class DuplicateImageFileComparitor extends DuplicateFileComparitor {
	private static final String[] LISTOFEXTENSIONS = { ".jpg", ".jpeg", ".gif",
			".bmp", ".tif", ".tiff" };

	public DuplicateImageFileComparitor(File pathtocompare) throws IOException {
		super(pathtocompare);
	}

	@Override
	protected void doComparison() {
		for (String key : listoffiles.keySet()) {
			for (File j : listoffiles.get(key)) {
				if (isValid(j) && listoffiles.get(key).size() > 1) {
					if (listofresults.get(key) == null)
						listofresults.put(key, new Vector<File>());

					listofresults.get(key).add(j);
				}
			}
		}
	}

	private boolean isValid(File fileToCheck) {
		boolean tr = false;
		for (String k : LISTOFEXTENSIONS) {
			if (fileToCheck.getName().toLowerCase().endsWith(k))
				tr = true;
		}

		return tr;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -