Java Code Examples for com.helger.commons.collection.impl.CommonsArrayList#add()

The following examples show how to use com.helger.commons.collection.impl.CommonsArrayList#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> CommonsArrayList <ELEMENTTYPE> newListPrefilled (@Nullable final ELEMENTTYPE aValue,
                                                                             @Nonnegative final int nElements)
{
  ValueEnforcer.isGE0 (nElements, "Elements");

  final CommonsArrayList <ELEMENTTYPE> ret = new CommonsArrayList <> (nElements);
  for (int i = 0; i < nElements; ++i)
    ret.add (aValue);
  return ret;
}
 
Example 2
Source File: CollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> CommonsArrayList <ELEMENTTYPE> newList (@Nullable final ELEMENTTYPE aValue)
{
  final CommonsArrayList <ELEMENTTYPE> ret = newList (1);
  ret.add (aValue);
  return ret;
}
 
Example 3
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Boolean> newPrimitiveList (@Nullable final boolean... aValues)
{
  final CommonsArrayList <Boolean> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final boolean aValue : aValues)
      ret.add (Boolean.valueOf (aValue));
  return ret;
}
 
Example 4
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Byte> newPrimitiveList (@Nullable final byte... aValues)
{
  final CommonsArrayList <Byte> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final byte aValue : aValues)
      ret.add (Byte.valueOf (aValue));
  return ret;
}
 
Example 5
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Character> newPrimitiveList (@Nullable final char... aValues)
{
  final CommonsArrayList <Character> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final char aValue : aValues)
      ret.add (Character.valueOf (aValue));
  return ret;
}
 
Example 6
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Double> newPrimitiveList (@Nullable final double... aValues)
{
  final CommonsArrayList <Double> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final double aValue : aValues)
      ret.add (Double.valueOf (aValue));
  return ret;
}
 
Example 7
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Float> newPrimitiveList (@Nullable final float... aValues)
{
  final CommonsArrayList <Float> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final float aValue : aValues)
      ret.add (Float.valueOf (aValue));
  return ret;
}
 
Example 8
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Integer> newPrimitiveList (@Nullable final int... aValues)
{
  final CommonsArrayList <Integer> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final int aValue : aValues)
      ret.add (Integer.valueOf (aValue));
  return ret;
}
 
Example 9
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Long> newPrimitiveList (@Nullable final long... aValues)
{
  final CommonsArrayList <Long> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final long aValue : aValues)
      ret.add (Long.valueOf (aValue));
  return ret;
}
 
Example 10
Source File: PrimitiveCollectionHelper.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nonnull
@ReturnsMutableCopy
public static CommonsArrayList <Short> newPrimitiveList (@Nullable final short... aValues)
{
  final CommonsArrayList <Short> ret = new CommonsArrayList <> ();
  if (aValues != null)
    for (final short aValue : aValues)
      ret.add (Short.valueOf (aValue));
  return ret;
}