當前位置: 首頁>>代碼示例>>Java>>正文


Java PeriodType.standard方法代碼示例

本文整理匯總了Java中org.joda.time.PeriodType.standard方法的典型用法代碼示例。如果您正苦於以下問題:Java PeriodType.standard方法的具體用法?Java PeriodType.standard怎麽用?Java PeriodType.standard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.joda.time.PeriodType的用法示例。


在下文中一共展示了PeriodType.standard方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: BasePeriod

import org.joda.time.PeriodType; //導入方法依賴的package包/類
/**
 * Creates a period from the given millisecond duration with the standard period type
 * and ISO rules, ensuring that the calculation is performed with the time-only period type.
 * <p>
 * The calculation uses the hour, minute, second and millisecond fields.
 *
 * @param duration  the duration, in milliseconds
 */
protected BasePeriod(long duration) {
    super();
    // bug [3264409]
    // calculation uses period type from a period object (bad design)
    // thus we use a dummy period object with the time type
    iType = PeriodType.standard();
    int[] values = ISOChronology.getInstanceUTC().get(DUMMY_PERIOD, duration);
    iValues = new int[8];
    System.arraycopy(values, 0, iValues, 4, 4);
}
 
開發者ID:redfish64,項目名稱:TinyTravelTracker,代碼行數:19,代碼來源:BasePeriod.java

示例2: calculateRunningTime

import org.joda.time.PeriodType; //導入方法依賴的package包/類
/**
 * Calculates the length of the time the interface has been running.
 * @return the running time, or Period. ZERO if not currently running
 */
@MonitorableStatusValue( name = "elapsed_running_time", description = "The amount of time the service has been running." )
public Period calculateRunningTime( ) {
	if( stopTime == null  ) {
		return new Period( startTime, new DateTime( DateTimeZone.UTC ), PeriodType.standard( ) );
	} else {
		return Period.ZERO;
	}
}
 
開發者ID:Talvish,項目名稱:Tales,代碼行數:13,代碼來源:Service.java

示例3: calculateRunningTime

import org.joda.time.PeriodType; //導入方法依賴的package包/類
/**
 * Calculates the length of the time the interface has been running.
 * @return the running time, or Period. ZERO if not currently running
 */
@MonitorableStatusValue( name = "elapsed_running_time", description = "The amount of time the interface has been running." )
public Period calculateRunningTime( ) {
	if( stopTime == null  ) {
		return new Period( startTime, new DateTime( DateTimeZone.UTC ), PeriodType.standard( ) );
	} else {
		return Period.ZERO;
	}
}
 
開發者ID:Talvish,項目名稱:Tales,代碼行數:13,代碼來源:InterfaceBase.java

示例4: calculateSuspendTime

import org.joda.time.PeriodType; //導入方法依賴的package包/類
/**
 * Calculates the length of the time the interface has been suspended.
 * @return the length of time suspended, or Period.ZERO if not suspended.
 */
@MonitorableStatusValue( name = "elapsed_suspend_time", description = "The amount of time the interface has been suspended." )
public Period calculateSuspendTime( ) {
	if( suspendTime != null  ) {
		return new Period( suspendTime, new DateTime( DateTimeZone.UTC ), PeriodType.standard( ) );
	} else {
		return Period.ZERO;
	}
}
 
開發者ID:Talvish,項目名稱:Tales,代碼行數:13,代碼來源:InterfaceBase.java

示例5: getPeriodType

import org.joda.time.PeriodType; //導入方法依賴的package包/類
/**
 * Selects a suitable period type for the given object.
 *
 * @param object  the object to examine
 * @return the period type, never null
 */
public PeriodType getPeriodType(Object object) {
    return PeriodType.standard();
}
 
開發者ID:redfish64,項目名稱:TinyTravelTracker,代碼行數:10,代碼來源:AbstractConverter.java


注:本文中的org.joda.time.PeriodType.standard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。