当前位置: 首页>>代码示例>>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;未经允许,请勿转载。