本文整理匯總了Java中javax.tools.JavaFileObject.getLastModified方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaFileObject.getLastModified方法的具體用法?Java JavaFileObject.getLastModified怎麽用?Java JavaFileObject.getLastModified使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.tools.JavaFileObject
的用法示例。
在下文中一共展示了JavaFileObject.getLastModified方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: preferredFileObject
import javax.tools.JavaFileObject; //導入方法依賴的package包/類
/**
* Implement policy to choose to derive information from a source
* file or a class file when both are present. May be overridden
* by subclasses.
*/
protected JavaFileObject preferredFileObject(JavaFileObject a,
JavaFileObject b) {
if (preferSource)
return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
else {
long adate = a.getLastModified();
long bdate = b.getLastModified();
// 6449326: policy for bad lastModifiedTime in ClassReader
//assert adate >= 0 && bdate >= 0;
return (adate > bdate) ? a : b;
}
}
示例2: preferredFileObject
import javax.tools.JavaFileObject; //導入方法依賴的package包/類
/** Implement policy to choose to derive information from a source
* file or a class file when both are present. May be overridden
* by subclasses.
*/
protected JavaFileObject preferredFileObject(JavaFileObject a,
JavaFileObject b) {
if (preferSource)
return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
else {
long adate = a.getLastModified();
long bdate = b.getLastModified();
// 6449326: policy for bad lastModifiedTime in ClassReader
//assert adate >= 0 && bdate >= 0;
return (adate > bdate) ? a : b;
}
}
示例3: ContentCacheEntry
import javax.tools.JavaFileObject; //導入方法依賴的package包/類
ContentCacheEntry(JavaFileObject file, CharBuffer cb) {
this.timestamp = file.getLastModified();
this.ref = new SoftReference<CharBuffer>(cb);
}
示例4: isValid
import javax.tools.JavaFileObject; //導入方法依賴的package包/類
boolean isValid(JavaFileObject file) {
return timestamp == file.getLastModified();
}
示例5: ContentCacheEntry
import javax.tools.JavaFileObject; //導入方法依賴的package包/類
ContentCacheEntry(JavaFileObject file, CharBuffer cb) {
this.timestamp = file.getLastModified();
this.ref = new SoftReference<>(cb);
}