本文整理匯總了Java中java.util.Date.hashCode方法的典型用法代碼示例。如果您正苦於以下問題:Java Date.hashCode方法的具體用法?Java Date.hashCode怎麽用?Java Date.hashCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.Date
的用法示例。
在下文中一共展示了Date.hashCode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getData
import java.util.Date; //導入方法依賴的package包/類
public List<DataPoint> getData ( final String item, final String type, final Date from, final Date to, final Integer number )
{
final List<DataPoint> result = new ArrayList<DataPoint> ();
final int seed = item.hashCode () + type.hashCode () + from.hashCode () + to.hashCode () + number.hashCode ();
final Random rndData = new Random ( seed );
final Random rndQuality = new Random ( seed * 13 );
final Random rndManual = new Random ( seed * 17 );
final double[] d = genTimeSeriesData ( rndData, number );
final double[] q = genTimeSeriesMeta ( rndQuality, number );
final double[] m = genTimeSeriesMeta ( rndManual, number );
final double delta = ( to.getTime () - from.getTime () ) / (double)number;
for ( int i = 0; i < d.length; i++ )
{
final DataPoint dp = new DataPoint ();
dp.setValue ( d[i] );
dp.setQuality ( q[i] );
dp.setManual ( m[i] );
dp.setTimestamp ( new Date ( Math.round ( from.getTime () + i * delta ) ) );
result.add ( dp );
}
return result;
}
示例2: hashCode
import java.util.Date; //導入方法依賴的package包/類
@Override
public int hashCode() {
Date xactStart = process.getQuery().getXactStart();
int result = 31 * process.getPid();
result = 31 * result + (xactStart != null ? xactStart.hashCode() : 0);
result = childrenHashCode(result, process.getChildren());
return result;
}