本文整理汇总了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();
}