Codota Logo
IdentifiableObjectUtils.getPeriodByPeriodType
Code IndexAdd Codota to your IDE (free)

How to use
getPeriodByPeriodType
method
in
org.hisp.dhis.common.IdentifiableObjectUtils

Best Java code snippets using org.hisp.dhis.common.IdentifiableObjectUtils.getPeriodByPeriodType (Showing top 1 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: dhis2/dhis2-core

/**
 * Returns a list of periods for each of the available period types defined by
 * {@link PeriodType#PERIOD_TYPES} in matching order relative to the given period.
 * 
 * @param period the period.
 * @param calendar the calendar.
 * @return a list of periods.
 */
public static List<Period> getPeriodTypePeriods( Period period, org.hisp.dhis.calendar.Calendar calendar )
{
  List<Period> periods = new ArrayList<>();
  
  PeriodType periodType = period.getPeriodType();
  
  for ( PeriodType type : PeriodType.PERIOD_TYPES )
  {
    if ( periodType.getFrequencyOrder() < type.getFrequencyOrder() || periodType.equals( type ) )
    {
      periods.add( IdentifiableObjectUtils.getPeriodByPeriodType( period, type, calendar ) );
    }
    else
    {
      periods.add( null );
    }
  }
  return periods;
}
org.hisp.dhis.commonIdentifiableObjectUtilsgetPeriodByPeriodType

Javadoc

Returns the Period of the argument period type which corresponds to the argument period. The frequency order of the given period type must greater than or equal to the period type of the given period (represent "longer" periods). Weeks are converted to "longer" periods by determining which period contains at least 4 days of the week.

As an example, providing Quarter 1, 2017 and Yearly as arguments will return the yearly period 2017.

Popular methods of IdentifiableObjectUtils

  • getIdentifiers
    Returns a list of internal identifiers for the given collection of IdentifiableObjects.
  • getUids
    Returns a list of uids for the given collection of IdentifiableObjects.
  • getIdMap
    Returns a map of the identifiable property specified by the given id scheme and the corresponding ob
  • getLocalPeriodIdentifier
    Returns a local period identifier for a specific period / calendar.
  • getLocalPeriodIdentifiers
    Returns a list of calendar specific period identifiers for the given collection of periods and calen
  • join
    Joins the names of the IdentifiableObjects in the given list and separates them with IdentifiableObj
  • getDisplayName
  • getUidObjectMap
    Returns a mapping between the uid and the name of the given identifiable objects.
  • removeDuplicates
    Removes duplicates from the given list while maintaining the order.

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now