当前位置: 首页>>代码示例>>Java>>正文


Java CGlobal.ILLEGAL_ULONG属性代码示例

本文整理汇总了Java中com.helger.commons.CGlobal.ILLEGAL_ULONG属性的典型用法代码示例。如果您正苦于以下问题:Java CGlobal.ILLEGAL_ULONG属性的具体用法?Java CGlobal.ILLEGAL_ULONG怎么用?Java CGlobal.ILLEGAL_ULONG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.helger.commons.CGlobal的用法示例。


在下文中一共展示了CGlobal.ILLEGAL_ULONG属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CombinationGenerator

/**
 * Ctor
 *
 * @param aElements
 *        the elements to fill into the slots for creating all combinations
 *        (must not be empty!)
 * @param nSlotCount
 *        the number of slots to use (must not be greater than the element
 *        count!)
 */
public CombinationGenerator (@Nonnull @Nonempty final ICommonsList <DATATYPE> aElements,
                             @Nonnegative final int nSlotCount)
{
  ValueEnforcer.notEmpty (aElements, "Elements");
  ValueEnforcer.isBetweenInclusive (nSlotCount, "SlotCount", 0, aElements.size ());

  m_aElements = GenericReflection.uncheckedCast (aElements.toArray ());
  m_aIndexResult = new int [nSlotCount];
  final BigInteger aElementFactorial = FactorialHelper.getAnyFactorialLinear (m_aElements.length);
  final BigInteger aSlotFactorial = FactorialHelper.getAnyFactorialLinear (nSlotCount);
  final BigInteger aOverflowFactorial = FactorialHelper.getAnyFactorialLinear (m_aElements.length - nSlotCount);
  m_aTotalCombinations = aElementFactorial.divide (aSlotFactorial.multiply (aOverflowFactorial));
  // Can we use the fallback to long? Is much faster than using BigInteger
  m_bUseLong = m_aTotalCombinations.compareTo (CGlobal.BIGINT_MAX_LONG) < 0;
  m_nTotalCombinations = m_bUseLong ? m_aTotalCombinations.longValue () : CGlobal.ILLEGAL_ULONG;
  reset ();
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:27,代码来源:CombinationGenerator.java

示例2: addValue

protected final void addValue (final long nValue)
{
  // Better performance when done manually
  m_aRWLock.writeLock ().lock ();
  try
  {
    m_nInvocationCount++;
    if (m_nMin == CGlobal.ILLEGAL_ULONG || nValue < m_nMin)
      m_nMin = nValue;
    if (m_nMax == CGlobal.ILLEGAL_ULONG || nValue > m_nMax)
      m_nMax = nValue;
    m_aSum = m_aSum.add (BigInteger.valueOf (nValue));
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:18,代码来源:AbstractStatisticsHandlerNumeric.java

示例3: getMillis

/**
 * Get the passed {@link XMLGregorianCalendar} as milli seconds.
 *
 * @param aCal
 *        The source {@link XMLGregorianCalendar}. May be <code>null</code>.
 * @return <code>{@link CGlobal#ILLEGAL_ULONG}</code> if the parameter is
 *         <code>null</code>.
 */
@CheckForSigned
public static long getMillis (@Nullable final XMLGregorianCalendar aCal)
{
  final GregorianCalendar aGregorianCalendar = getGregorianCalendar (aCal);
  return aGregorianCalendar == null ? CGlobal.ILLEGAL_ULONG : aGregorianCalendar.getTimeInMillis ();
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:14,代码来源:PDTXMLConverter.java


注:本文中的com.helger.commons.CGlobal.ILLEGAL_ULONG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。