日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > java >内容正文

java

java处理脏数据,Java程序的脏数据问题

發(fā)布時間:2023/12/20 java 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java处理脏数据,Java程序的脏数据问题 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

臟數(shù)據(jù)(Out-of-date data),指過時的數(shù)據(jù)。

假如在您的java程序中存在臟數(shù)據(jù),將或多或少地給軟件系統(tǒng)帶來一些問題,如:無法實時地應(yīng)用已經(jīng)發(fā)生改變的配置,軟件系統(tǒng)出現(xiàn)一些莫名其妙的、難以重現(xiàn)的、后果嚴重的錯誤等等。盡量避免臟數(shù)據(jù)的存在是非常有價值的。本文希望能在這方面給同行們一點幫助。

Fragment 1. 緩存技術(shù)的臟數(shù)據(jù)問題

/**

* A report PRinter is used to print a report.

*

* @version 1.0 9/9/2003

* @author Bill

*/

public class ReportPrinter {

/**

* ConstrUCts a ReportPrinter instance.

*/

public ReportPrinter() {

// do something...

}

/**

* Prints a printable.

*

* @param printable the specified printable object

*/

public void print(Printable printable) {

Graphics g = getGraphics();

g.setFont(getReportFont(printable.getFont());

printable.print(g);

}

/**

* Returns the corresponding report font of a java font.

*

* @param javaFont the specified java font

* @return the corresponding report font

*/

private Font getReportFont(font javaFont) {

Font reportFont = fontMap.get(javaFont);

if(reportFont == null) {

reportFont = loadFont(javaFont);

fontMap.put(javaFont, reportFont);

}

return reportFont;

}

/**

* Loads the corresponding report font of a java font.

*

* @param javaFont the specified java font

* @param the corresponding report font

*/

protected static Font loadFont(Font javaFont) {

Font reportFont = null;

總結(jié)

以上是生活随笔為你收集整理的java处理脏数据,Java程序的脏数据问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。