Java Collection Null padWithNulls(final Collection s1, final Collection s2)

Here you can find the source of padWithNulls(final Collection s1, final Collection s2)

Description

pad With Nulls

License

Open Source License

Declaration

private static void padWithNulls(final Collection<String> s1, final Collection<String> s2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    private static void padWithNulls(final Collection<String> s1, final Collection<String> s2) {
        if (s1.size() != s2.size()) {
            while (s1.size() < s2.size()) {
                s1.add(null);/*www  .j  a v a2  s  . c om*/
            }
            while (s1.size() > s2.size()) {
                s2.add(null);
            }
        }
    }
}

Related

  1. nullSafe(Collection collection)
  2. nullSafe(Collection in)
  3. nullSafeCollection(Collection source)
  4. nullSafeSize(Collection collection)
  5. nullSafeSize(final Collection collection)
  6. removeAllIfNotNull(final Collection collection, final Collection c)
  7. removeNull(Collection collection)
  8. removeNull(final Collection c)
  9. removeNullElement(Collection collection)