Java Code Examples for com.ibm.icu.util.Calendar#MILLISECOND
The following examples show how to use
com.ibm.icu.util.Calendar#MILLISECOND .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UomWorker.java From scipio-erp with Apache License 2.0 | 5 votes |
public static int[] uomTimeToCalTime(String uomId) { if ("TF_ms".equals(uomId)) { return new int[] { Calendar.MILLISECOND, 1 }; } else if ("TF_s".equals(uomId)) { return new int[] { Calendar.SECOND, 1 }; } else if ("TF_min".equals(uomId)) { return new int[] { Calendar.MINUTE, 1 }; } else if ("TF_hr".equals(uomId)) { return new int[] { Calendar.HOUR, 1 }; } else if ("TF_day".equals(uomId)) { return new int[] { Calendar.DAY_OF_YEAR, 1 }; } else if ("TF_wk".equals(uomId)) { return new int[] { Calendar.WEEK_OF_YEAR, 1 }; } else if ("TF_mon".equals(uomId)) { return new int[] { Calendar.MONTH, 1 }; } else if ("TF_yr".equals(uomId)) { return new int[] { Calendar.YEAR, 1 }; } else if ("TF_decade".equals(uomId)) { return new int[] { Calendar.YEAR, 10 }; } else if ("TF_score".equals(uomId)) { return new int[] { Calendar.YEAR, 20 }; } else if ("TF_century".equals(uomId)) { return new int[] { Calendar.YEAR, 100 }; } else if ("TF_millenium".equals(uomId)) { return new int[] { Calendar.YEAR, 1000 }; } return null; }
Example 2
Source File: SeriesNameFormat.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Convert GroupingUnit type to CDateUnit type. * * @param groupingUnitType * the GroupingUnit type. * @return CDateUnit type of integer. * @since 2.3, it is merged from <code>DataProcessor</code>, make the * method to be a static usage. */ private static int groupingUnit2CDateUnit( GroupingUnitType groupingUnitType ) { if ( groupingUnitType != null ) { switch ( groupingUnitType.getValue( ) ) { case GroupingUnitType.SECONDS : return Calendar.SECOND; case GroupingUnitType.MINUTES : return Calendar.MINUTE; case GroupingUnitType.HOURS : return Calendar.HOUR_OF_DAY; case GroupingUnitType.DAYS : return Calendar.DATE; case GroupingUnitType.WEEKS : return Calendar.WEEK_OF_YEAR; case GroupingUnitType.MONTHS : return Calendar.MONTH; case GroupingUnitType.YEARS : return Calendar.YEAR; case GroupingUnitType.QUARTERS : return GroupingUnitType.QUARTERS; } } return Calendar.MILLISECOND; }
Example 3
Source File: GroupingUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Convert GroupingUnit type to CDateUnit type. * * @param groupingUnitType the GroupingUnit type. * @return CDateUnit type of integer. * @since 2.3, it is merged from <code>DataProcessor</code>, make the method to be a static usage. */ public static int groupingUnit2CDateUnit( GroupingUnitType groupingUnitType ) { if ( groupingUnitType != null ) { switch ( groupingUnitType.getValue( ) ) { case GroupingUnitType.SECONDS : return Calendar.SECOND; case GroupingUnitType.MINUTES : return Calendar.MINUTE; case GroupingUnitType.HOURS : return Calendar.HOUR_OF_DAY; case GroupingUnitType.DAYS : case GroupingUnitType.DAY_OF_MONTH : return Calendar.DAY_OF_MONTH; case GroupingUnitType.DAY_OF_QUARTER : return CDateTime.DAY_OF_QUARTER; case GroupingUnitType.DAY_OF_WEEK : return Calendar.DAY_OF_WEEK; case GroupingUnitType.DAY_OF_YEAR : return Calendar.DAY_OF_YEAR; case GroupingUnitType.WEEKS : case GroupingUnitType.WEEK_OF_MONTH : return Calendar.WEEK_OF_MONTH; case GroupingUnitType.WEEK_OF_YEAR : return Calendar.WEEK_OF_YEAR; case GroupingUnitType.MONTHS : return Calendar.MONTH; case GroupingUnitType.QUARTERS : return CDateTime.QUARTER; case GroupingUnitType.YEARS : return Calendar.YEAR; case GroupingUnitType.WEEK_OF_QUARTER : return CDateTime.WEEK_OF_QUARTER; } } return Calendar.MILLISECOND; }
Example 4
Source File: CDateTime.java From birt with Eclipse Public License 1.0 | 5 votes |
private static final int getDefaultUnit( CDateTime c ) { if ( c.isTimeOnly( ) ) { return Calendar.SECOND; } if ( c.isFullDateTime( ) ) { return Calendar.MILLISECOND; } return Calendar.DATE; }
Example 5
Source File: TimeDimensionUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
public static int getFieldIndex( String fieldName ) { if( fieldName.equals( YEAR ) ) return Calendar.YEAR; else if( fieldName.equals( MONTH ) ) return Calendar.MONTH; else if( fieldName.equals( WEEK_OF_YEAR ) ) return Calendar.WEEK_OF_YEAR; else if( fieldName.equals( WEEK_OF_MONTH ) ) return Calendar.WEEK_OF_MONTH; else if( fieldName.equals( DAY_OF_MONTH ) ) return Calendar.DAY_OF_MONTH; else if( fieldName.equals( DAY_OF_YEAR ) ) return Calendar.DAY_OF_YEAR; else if( fieldName.equals( DAY_OF_WEEK ) ) return Calendar.DAY_OF_WEEK; else if( fieldName.equals( HOUR ) ) return Calendar.HOUR; else if( fieldName.equals( HOUR_OF_DAY ) ) return Calendar.HOUR_OF_DAY; else if( fieldName.equals( MINUTE ) ) return Calendar.MINUTE; else if( fieldName.equals( SECOND ) ) return Calendar.SECOND; else if( fieldName.equals( MILLISECOND ) ) return Calendar.MILLISECOND; return -1; }
Example 6
Source File: TimeDimensionUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
public static String getFieldName( int fieldIndex ) { switch (fieldIndex) { case Calendar.YEAR: return YEAR; case Calendar.MONTH: return MONTH; case Calendar.WEEK_OF_YEAR: return WEEK_OF_YEAR; case Calendar.WEEK_OF_MONTH: return WEEK_OF_MONTH; case Calendar.DAY_OF_MONTH: return DAY_OF_MONTH; case Calendar.DAY_OF_YEAR: return DAY_OF_YEAR; case Calendar.DAY_OF_WEEK: return DAY_OF_WEEK; case Calendar.HOUR: return HOUR; case Calendar.HOUR_OF_DAY: return HOUR_OF_DAY; case Calendar.MINUTE: return MINUTE; case Calendar.SECOND: return SECOND; case Calendar.MILLISECOND: return MILLISECOND; } return null; }