我正在仔细检查源代码Apache Commons库。我的问题是为什么他们对每个验证器类都使用var pattern = /(\d{2})\-(\d{2})\-(\d{4})\s(\d{2}):(\d{2}):(\d{2})/;
this.fetchedData.sort(function compare(a, b) {
var dateA = +new Date(a.date.replace(pattern,'$3-$2-$1T$4:$5:$6'));
var dateB = +new Date(b.date.replace(pattern,'$3-$2-$1T$4:$5:$6'));
return dateB - dateA;
});
,例如EmailValidatore,ISBNValidator类?
它使我对Serializable
用例感到困惑。有人可以在这里证明Serializable
的用例吗?