本文整理匯總了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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}