All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lapissea.filechange.FileChangeInfo Maven / Gradle / Ivy

Go to download

An abstraction of folder/zip/jar reading with multi source fallback and lazy caching and SQL emulated mutable file system.

There is a newer version: 1.0.4
Show newest version
package com.lapissea.filechange;

public class FileChangeInfo{
	
	public static final FileChangeInfo NULL=new FileChangeInfo(-1, -1){
		@Override
		boolean chaged(FileChangeInfo file){
			return true;
		}
	};
	
	final long changeTime, size;
	
	public FileChangeInfo(long changeTime, long size){
		this.changeTime=changeTime;
		this.size=size;
	}
	
	@Override
	public int hashCode(){
		return (int)(size+changeTime);
	}
	
	@Override
	public boolean equals(Object obj){
		if(obj==this) return true;
		if(!(obj instanceof FileChangeInfo)) return false;
		FileChangeInfo o=(FileChangeInfo)obj;
		return changeTime==o.changeTime&&size==o.size;
	}
	
	boolean chaged(FileChangeInfo file){
		if(file==NULL) return true;
		if(size!=file.size) return true;
		return changeTime




© 2015 - 2024 Weber Informatics LLC | Privacy Policy