Codota Logo
ValueType.isNumeric
Code IndexAdd Codota to your IDE (free)

How to use
isNumeric
method
in
org.hisp.dhis.common.ValueType

Best Java code snippets using org.hisp.dhis.common.ValueType.isNumeric (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: dhis2/dhis2-core

/**
 * Indicates whether the value type of this attribute is numeric.
 */
public boolean isNumericType()
{
  return valueType.isNumeric();
}
origin: dhis2/dhis2-core

public boolean isNumeric()
{
  return valueType.isNumeric();
}
origin: dhis2/dhis2-core

/**
 * Indicates whether the value type of this data element is numeric.
 */
public boolean isNumericType()
{
  return getValueType().isNumeric();
}
origin: dhis2/dhis2-core

/**
 * Indicates whether the value is a zero.
 */
public boolean isZero()
{
  return dataElement != null && dataElement.getValueType().isNumeric() && value != null && ZERO_PATTERN.matcher( value ).find();
}
origin: dhis2/dhis2-core

/**
 * Returns a string useful for substitution.
 *
 * @param valueType the value type.
 * @return the string.
 */
public static String getSubstitutionValue( ValueType valueType )
{
  if ( valueType.isNumeric() || valueType.isBoolean() )
  {
    return "1";
  }
  else if ( valueType.isDate() )
  {
    return "'2000-01-01'";
  }
  else
  {
    return "'A'";
  }
}
origin: dhis2/dhis2-core

private RuleValueType toMappedValueType( ProgramRuleVariable programRuleVariable )
{
  ValueType valueType = VALUE_TYPE_MAPPER.getOrDefault( programRuleVariable.getSourceType(), prv -> ValueType.TEXT ).apply( programRuleVariable );
  if ( valueType.isBoolean() )
  {
    return RuleValueType.BOOLEAN;
  }
  if ( valueType.isText() )
  {
    return RuleValueType.TEXT;
  }
  if ( valueType.isNumeric() )
  {
    return RuleValueType.NUMERIC;
  }
  return RuleValueType.TEXT;
}
origin: dhis2/dhis2-core

/**
 * Indicates whether the given value is zero and not zero significant according
 * to its data element.
 *
 * @param value       the data value.
 * @param dataElement the data element.
 */
public static boolean dataValueIsZeroAndInsignificant( String value, DataElement dataElement )
{
  AggregationType aggregationType = dataElement.getAggregationType();
  return dataElement.getValueType().isNumeric() && MathUtils.isZero( value ) && !dataElement.isZeroIsSignificant() &&
    !( aggregationType == AggregationType.AVERAGE_SUM_ORG_UNIT || aggregationType == AggregationType.AVERAGE );
}
origin: dhis2/dhis2-core

if ( !dataElement.getValueType().isNumeric() )
origin: dhis2/dhis2-core

if ( valueType.isText() || valueType.isNumeric() || ValueType.USERNAME == valueType )
origin: dhis2/dhis2-core

if ( dataElement.getValueType().isNumeric() && stdDevFactor != null )
origin: dhis2/dhis2-core

if ( dataElement.getValueType().isNumeric() )
origin: dhis2/dhis2-core

else if ( valueType.isText() || valueType.isNumeric() || ValueType.USERNAME == valueType )
origin: dhis2/dhis2-core

private String getTrackedEntityAttributeValue( TrackedEntityAttributeValue attributeValue )
{
  ValueType valueType = attributeValue.getAttribute().getValueType();
  if ( valueType.isBoolean() )
  {
    return attributeValue.getValue() != null ? attributeValue.getValue() : "false";
  }
  if ( valueType.isNumeric() )
  {
    return attributeValue.getValue() != null ? attributeValue.getValue() : "0";
  }
  return attributeValue.getValue() != null ? attributeValue.getValue() : "";
}
origin: dhis2/dhis2-core

  private String getTrackedEntityDataValue( TrackedEntityDataValue dataValue )
  {
    ValueType valueType = dataValue.getDataElement().getValueType();

    if ( valueType.isBoolean() )
    {
      return dataValue.getValue() != null ? dataValue.getValue() : "false";
    }

    if ( valueType.isNumeric() )
    {
      return dataValue.getValue() != null ? dataValue.getValue() : "0";
    }

    return dataValue.getValue() != null ? dataValue.getValue() : "";
  }
}
origin: dhis2/dhis2-core

else if ( type.isNumeric() )
origin: dhis2/dhis2-core

  CategoryOptionCombo attributeOptionCombo, OrganisationUnit organisationUnit, Period lastPeriod, int historyLength )
if ( !dataElement.getValueType().isNumeric() )
origin: dhis2/dhis2-core

if ( dv.getDataElement().getValueType().isNumeric() )
origin: dhis2/dhis2-core

else if ( valueType.isNumeric() )
org.hisp.dhis.commonValueTypeisNumeric

Javadoc

Includes integer and decimal types.

Popular methods of ValueType

  • isFile
  • isText
  • isBoolean
  • isDate
  • isInteger
  • equals
  • toString
  • getJavaClass
  • hashCode
  • isAggregateable
  • isDecimal
  • isGeo
  • isDecimal,
  • isGeo,
  • isOrganisationUnit,
  • name,
  • valueOf

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JButton (javax.swing)
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