本文整理汇总了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 ();
}
示例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 ();
}
}
示例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 ();
}