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


Java EChange.or方法代码示例

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


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

示例1: addAllMapped

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
 * Add all passed elements matching the provided filter after performing a
 * mapping using the provided function.
 *
 * @param aElements
 *        The elements to be added after mapping. May be <code>null</code>.
 * @param aFilter
 *        The filter to be applied. May be <code>null</code>.
 * @param aMapper
 *        The mapping function to be executed for all provided elements. May
 *        not be <code>null</code>.
 * @return {@link EChange#CHANGED} if at least one element was added,
 *         {@link EChange#UNCHANGED}. Never <code>null</code>.
 * @param <SRCTYPE>
 *        The source type to be mapped from
 */
@Nonnull
default <SRCTYPE> EChange addAllMapped (@Nullable final SRCTYPE [] aElements,
                                        @Nullable final Predicate <? super SRCTYPE> aFilter,
                                        @Nonnull final Function <? super SRCTYPE, ? extends ELEMENTTYPE> aMapper)
{
  ValueEnforcer.notNull (aMapper, "Mapper");

  if (aFilter == null)
    return addAllMapped (aElements, aMapper);

  EChange eChange = EChange.UNCHANGED;
  if (aElements != null)
    for (final SRCTYPE aValue : aElements)
      if (aFilter.test (aValue))
        eChange = eChange.or (add (aMapper.apply (aValue)));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:34,代码来源:ICommonsCollection.java

示例2: addAll

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
 * Add all elements of the passed enumeration to this collection.
 *
 * @param aEnum
 *        The enumeration to be iterated and the elements to be added. May be
 *        <code>null</code>.
 * @param aFilter
 *        The filter to be applied. May be <code>null</code>.
 * @return {@link EChange#CHANGED} if at least one element was added,
 *         {@link EChange#UNCHANGED}. Never <code>null</code>.
 * @since 8.5.2
 */
@Nonnull
default EChange addAll (@Nullable final Enumeration <? extends ELEMENTTYPE> aEnum,
                        @Nullable final Predicate <? super ELEMENTTYPE> aFilter)
{
  if (aFilter == null)
    return addAll (aEnum);

  EChange eChange = EChange.UNCHANGED;
  if (aEnum != null)
    while (aEnum.hasMoreElements ())
    {
      final ELEMENTTYPE aElement = aEnum.nextElement ();
      if (aFilter.test (aElement))
        eChange = eChange.or (add (aElement));
    }
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:30,代码来源:ICommonsCollection.java

示例3: visit

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Override
@Nonnull
public EChange visit (@Nonnull final IPLVisitor aVisitor) throws IOException
{
  EChange ret = EChange.UNCHANGED;
  for (final PLHBoxColumn aColumn : m_aColumns)
    ret = ret.or (aColumn.getElement ().visit (aVisitor));
  return ret;
}
 
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:10,代码来源:AbstractPLHBox.java

示例4: putAllIn

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
 * Add all values into the container identified by the passed key-value-map.
 *
 * @param aMap
 *        The key-value-map to use. May not be <code>null</code>.
 * @return {@link EChange}
 */
@Nonnull
default EChange putAllIn (@Nonnull final Map <? extends KEYTYPE1, ? extends Map <KEYTYPE2, VALUETYPE>> aMap)
{
  EChange eChange = EChange.UNCHANGED;
  for (final Map.Entry <? extends KEYTYPE1, ? extends Map <KEYTYPE2, VALUETYPE>> aEntry : aMap.entrySet ())
    for (final Map.Entry <KEYTYPE2, VALUETYPE> aEntry2 : aEntry.getValue ().entrySet ())
      eChange = eChange.or (putSingle (aEntry.getKey (), aEntry2.getKey (), aEntry2.getValue ()));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:17,代码来源:IMultiMapMapBased.java

示例5: setAllToDefault

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange setAllToDefault ()
{
  EChange eChange = EChange.UNCHANGED;
  for (final String sFieldName : m_aDefaultSettings.keySet ())
    eChange = eChange.or (setToDefault (sFieldName));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:9,代码来源:SettingsWithDefault.java

示例6: removeRelation

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange removeRelation (@Nullable final IMutableGraphRelation aRelation)
{
  EChange ret = EChange.UNCHANGED;
  if (aRelation != null)
  {
    for (final IMutableGraphNode aNode : aRelation.getAllConnectedNodes ())
      ret = ret.or (aNode.removeRelation (aRelation));
    if (ret.isChanged ())
      _invalidateCache ();
  }
  return ret;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:14,代码来源:Graph.java

示例7: removeRelation

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange removeRelation (@Nullable final IMutableDirectedGraphRelation aRelation)
{
  EChange ret = EChange.UNCHANGED;
  if (aRelation != null)
  {
    ret = ret.or (aRelation.getFrom ().removeOutgoingRelation (aRelation));
    ret = ret.or (aRelation.getTo ().removeIncomingRelation (aRelation));
    if (ret.isChanged ())
      _invalidateCache ();
  }
  return ret;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:14,代码来源:DirectedGraph.java

示例8: visit

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Override
@Nonnull
public EChange visit (@Nonnull final IPLVisitor aVisitor) throws IOException
{
  final EChange ret = super.visit (aVisitor);
  return ret.or (m_aRows.visit (aVisitor));
}
 
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:8,代码来源:PLTable.java

示例9: removeVariables

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
 * Remove multiple variables at once.
 *
 * @param aNames
 *        The names to be removed. May be <code>null</code>.
 * @return {@link EChange#CHANGED} if at least one variable was removed.
 */
@Nonnull
public EChange removeVariables (@Nullable final Iterable <String> aNames)
{
  EChange eChange = EChange.UNCHANGED;
  if (aNames != null)
    for (final String sName : aNames)
      eChange = eChange.or (removeVariable (sName));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:17,代码来源:MapBasedXPathVariableResolver.java

示例10: removeVariables

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
 * Remove multiple variables at once.
 *
 * @param aNames
 *        The names to be removed. May be <code>null</code>.
 * @return {@link EChange#CHANGED} if at least one variable was removed.
 */
@Nonnull
public EChange removeVariables (@Nullable final Iterable <? extends QName> aNames)
{
  EChange eChange = EChange.UNCHANGED;
  if (aNames != null)
    for (final QName aName : aNames)
      eChange = eChange.or (removeVariable (aName));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:17,代码来源:MapBasedXPathVariableResolverQName.java

示例11: putAllIn

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
default EChange putAllIn (@Nullable final Map <? extends KEYTYPE, ? extends VALUETYPE> aAttrs)
{
  EChange eChange = EChange.UNCHANGED;
  if (aAttrs != null)
    for (final Map.Entry <? extends KEYTYPE, ? extends VALUETYPE> aEntry : aAttrs.entrySet ())
      eChange = eChange.or (putIn (aEntry.getKey (), aEntry.getValue ()));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:10,代码来源:IAttributeContainer.java

示例12: visit

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange visit (@Nonnull final IPLVisitor aVisitor) throws IOException
{
  EChange ret = EChange.UNCHANGED;
  aVisitor.onPageSetStart (this);
  if (m_aPageHeader != null)
    ret = ret.or (m_aPageHeader.visit (aVisitor));
  if (m_aPageFooter != null)
    ret = ret.or (m_aPageFooter.visit (aVisitor));
  for (final IPLRenderableObject <?> aElement : m_aElements)
    ret = ret.or (aElement.visit (aVisitor));
  aVisitor.onPageSetEnd (this);
  return ret;
}
 
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:15,代码来源:PLPageSet.java

示例13: visit

import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Override
@Nonnull
public EChange visit (@Nonnull final IPLVisitor aVisitor) throws IOException
{
  EChange ret = EChange.UNCHANGED;
  for (final PLVBoxRow aRow : m_aRows)
    ret = ret.or (aRow.getElement ().visit (aVisitor));
  return ret;
}
 
开发者ID:phax,项目名称:ph-pdf-layout,代码行数:10,代码来源:AbstractPLVBox.java


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