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


Java CGlobal.ILLEGAL_UINT属性代码示例

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


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

示例1: PSBoundSchemaCache

public PSBoundSchemaCache (@Nonnull final String sCacheName)
{
  super (aKey -> {
    ValueEnforcer.notNull (aKey, "Key");

    try
    {
      return aKey.createBoundSchema ();
    }
    catch (final SchematronException ex)
    {
      // Convert to an unchecked exception :(
      throw new IllegalArgumentException (ex);
    }
  }, CGlobal.ILLEGAL_UINT, sCacheName);
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:16,代码来源:PSBoundSchemaCache.java

示例2: getPath

/**
 * Get the path of the passed file name without any eventually contained
 * filename.
 *
 * @param sAbsoluteFilename
 *        The fully qualified file name. May be <code>null</code>.
 * @return The path only including the last trailing path separator character.
 *         Returns <code>null</code> if the passed parameter is
 *         <code>null</code>.
 * @see #getIndexOfLastSeparator(String)
 */
@Nullable
public static String getPath (@Nullable final String sAbsoluteFilename)
{
  /**
   * Note: do not use <code>new File (sFilename).getPath ()</code> since this
   * only invokes the underlying FileSystem implementation which handles path
   * handling only correctly on the native platform. Problem arose when
   * running application on a Linux server and making a file upload from a
   * Windows machine.
   */
  if (sAbsoluteFilename == null)
    return null;
  final int nLastSepIndex = getIndexOfLastSeparator (sAbsoluteFilename);
  return nLastSepIndex == CGlobal.ILLEGAL_UINT ? "" : sAbsoluteFilename.substring (0, nLastSepIndex + 1);
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:26,代码来源:FilenameHelper.java

示例3: LocaleListCache

public LocaleListCache ()
{
  // Unlimited size
  super (aBaseLocale -> {
    ValueEnforcer.notNull (aBaseLocale, "BaseLocale");

    // List has a maximum of 3 entries
    final ICommonsList <Locale> ret = new CommonsArrayList <> (3);
    final String sLanguage = aBaseLocale.getLanguage ();
    if (sLanguage.length () > 0)
    {
      final LocaleCache aLC = LocaleCache.getInstance ();

      // Use only the language
      ret.add (0, aLC.getLocale (sLanguage));
      final String sCountry = aBaseLocale.getCountry ();
      if (sCountry.length () > 0)
      {
        // Use language + country
        ret.add (0, aLC.getLocale (sLanguage, sCountry));
        final String sVariant = aBaseLocale.getVariant ();
        if (sVariant.length () > 0)
        {
          // Use language + country + variant
          ret.add (0, aLC.getLocale (sLanguage, sCountry, sVariant));
        }
      }
    }
    return ret.getAsUnmodifiable ();
  }, CGlobal.ILLEGAL_UINT, LocaleListCache.class.getName ());
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:31,代码来源:LocaleHelper.java

示例4: readStreamLines

/**
 * Read the content of the passed stream line by line and invoking a callback
 * on all matching lines.
 *
 * @param aIS
 *        The input stream to read from. May be <code>null</code>.
 * @param aCharset
 *        The character set to use. May not be <code>null</code>.
 * @param nLinesToSkip
 *        The 0-based index of the first line to read. Pass in 0 to indicate
 *        to read everything.
 * @param nLinesToRead
 *        The number of lines to read. Pass in {@link CGlobal#ILLEGAL_UINT} to
 *        indicate that all lines should be read. If the number passed here
 *        exceeds the number of lines in the file, nothing happens.
 * @param aLineCallback
 *        The callback that is invoked for all read lines. Each passed line
 *        does NOT contain the line delimiter! Note: it is not invoked for
 *        skipped lines!
 */
public static void readStreamLines (@WillClose @Nullable final InputStream aIS,
                                    @Nonnull @Nonempty final Charset aCharset,
                                    @Nonnegative final int nLinesToSkip,
                                    final int nLinesToRead,
                                    @Nonnull final Consumer <? super String> aLineCallback)
{
  try
  {
    ValueEnforcer.notNull (aCharset, "Charset");
    ValueEnforcer.isGE0 (nLinesToSkip, "LinesToSkip");
    final boolean bReadAllLines = nLinesToRead == CGlobal.ILLEGAL_UINT;
    ValueEnforcer.isTrue (bReadAllLines || nLinesToRead >= 0,
                          () -> "Line count may not be that negative: " + nLinesToRead);
    ValueEnforcer.notNull (aLineCallback, "LineCallback");

    // Start the action only if there is something to read
    if (aIS != null)
      if (bReadAllLines || nLinesToRead > 0)
      {
        try (final NonBlockingBufferedReader aBR = new NonBlockingBufferedReader (createReader (aIS, aCharset)))
        {
          // read with the passed charset
          _readFromReader (nLinesToSkip, nLinesToRead, aLineCallback, bReadAllLines, aBR);
        }
        catch (final IOException ex)
        {
          s_aLogger.error ("Failed to read from input stream", ex instanceof IMockException ? null : ex);
        }
      }
  }
  finally
  {
    // Close input stream in case something went wrong with the buffered
    // reader.
    close (aIS);
  }
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:57,代码来源:StreamHelper.java

示例5: onMarkAsNotPrepared

@Override
protected void onMarkAsNotPrepared ()
{
  m_nPreparedLineCountUnmodified = CGlobal.ILLEGAL_UINT;
  m_aPreparedLinesUnmodified = null;
  m_aPreparedLines = null;
}
 
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:7,代码来源:AbstractPLText.java

示例6: getFirstTokenBeginLineNumber

/**
 * @return The line number where the first token begins (incl.). May be -1 if
 *         not such token is available.
 */
@CheckForSigned
public int getFirstTokenBeginLineNumber ()
{
  return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenBeginLineNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例7: getFirstTokenBeginColumnNumber

/**
 * @return The column number where the first token begins (incl.). May be -1
 *         if not such token is available.
 */
@CheckForSigned
public int getFirstTokenBeginColumnNumber ()
{
  return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenBeginColumnNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例8: getFirstTokenEndLineNumber

/**
 * @return The line number where the fist token ends (incl.). May be -1 if not
 *         such token is available.
 */
@CheckForSigned
public int getFirstTokenEndLineNumber ()
{
  return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenEndLineNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例9: getFirstTokenEndColumnNumber

/**
 * @return The column number where the first token ends (incl.). May be -1 if
 *         not such token is available.
 */
@CheckForSigned
public int getFirstTokenEndColumnNumber ()
{
  return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenEndColumnNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例10: getLastTokenBeginLineNumber

/**
 * @return The line number where the last token begins (incl.). May be -1 if
 *         not such token is available.
 */
@CheckForSigned
public int getLastTokenBeginLineNumber ()
{
  return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenBeginLineNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例11: getLastTokenBeginColumnNumber

/**
 * @return The column number where the last token begins (incl.). May be -1 if
 *         not such token is available.
 */
@CheckForSigned
public int getLastTokenBeginColumnNumber ()
{
  return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenBeginColumnNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例12: getLastTokenEndLineNumber

/**
 * @return The line number where the fist token ends (incl.). May be -1 if not
 *         such token is available.
 */
@CheckForSigned
public int getLastTokenEndLineNumber ()
{
  return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenEndLineNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例13: getLastTokenEndColumnNumber

/**
 * @return The column number where the last token ends (incl.). May be -1 if
 *         not such token is available.
 */
@CheckForSigned
public int getLastTokenEndColumnNumber ()
{
  return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenEndColumnNumber ();
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:9,代码来源:STXSourceLocation.java

示例14: getLastIndex

/**
 * Get the index of the passed search value in the passed value array.
 *
 * @param aValues
 *        The value array to be searched. May be <code>null</code>.
 * @param aSearchValue
 *        The value to be searched. May be <code>null</code>.
 * @return <code>-1</code> if the searched value is not contained, a value
 *         &ge; 0 otherwise.
 */
public static int getLastIndex (@Nullable final long [] aValues, final long aSearchValue)
{
  final int nLength = getSize (aValues);
  if (nLength > 0)
    for (int nIndex = nLength - 1; nIndex >= 0; --nIndex)
      if (EqualsHelper.equals (aValues[nIndex], aSearchValue))
        return nIndex;
  return CGlobal.ILLEGAL_UINT;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:19,代码来源:ArrayHelper.java

示例15: getIndexOfExtension

/**
 * Returns the index of the last extension separator character, which is a
 * dot.
 * <p>
 * This method also checks that there is no directory separator after the last
 * dot. To do this it uses {@link #getIndexOfLastSeparator(String)} which will
 * handle a file in either Unix or Windows format.
 * <p>
 * The output will be the same irrespective of the machine that the code is
 * running on.
 *
 * @param sFilename
 *        The filename to find the last path separator in. May be
 *        <code>null</code>.
 * @return the index of the last separator character, or
 *         {@link CGlobal#ILLEGAL_UINT} if there is no such character or the
 *         input parameter is <code>null</code>.
 * @see #getIndexOfLastSeparator(String)
 */
public static int getIndexOfExtension (@Nullable final String sFilename)
{
  if (sFilename == null)
    return CGlobal.ILLEGAL_UINT;

  final int nExtensionIndex = sFilename.lastIndexOf (EXTENSION_SEPARATOR);
  final int nLastSepIndex = getIndexOfLastSeparator (sFilename);
  return nLastSepIndex > nExtensionIndex ? CGlobal.ILLEGAL_UINT : nExtensionIndex;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:28,代码来源:FilenameHelper.java


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