Java Utililty Methods List Size

List of utility methods to do List Size

  1. HOME
  2. Java
  3. L
  4. List Size

Description

The list of methods to do List Size are organized into topic(s).

Method

int getSize(List list)
get Size
if (isEmpty(list)) {
 return 0;
return list.size();
String getSize(List list)
get Size
return (String) (list != null ? list.size() : "0");
double[] getSize(List positions)
get Size
if (positions.size() > 0) {
 int[] min = getExtremeCoords(positions, true);
 int[] max = getExtremeCoords(positions, false);
 double[] result = new double[min.length];
 for (int i = 0; i < min.length; i++) {
 result[i] = (float) (max[i] - min[i] + 1) * 0.5f;
 return result;
...
int getSize(List sourceList)
get size of list
 getSize(null) = 0; getSize({}) = 0; getSize({1}) = 1; 
return sourceList == null ? 0 : sourceList.size();
int getSize(List sourceList)
get Size
return sourceList == null ? 0 : sourceList.size();
int size(List list)
size
if (list == null) {
 return 0;
return list.size();
int size(Object[] list)
size
if (list == null) {
 return 0;
} else {
 return list.length;
int sizeNotNull(final List list)
size Not Null
int count = 0;
for (E e : list) {
 if (e != null) {
 count++;
return count;
Integer sizeOf(List l)
This function always returns the size of a list; no matter if it is null, 0 or >0.
return l != null ? l.size() : 0;
int sizeOfListMap(Map> map)
Get the total number of elements in a map whose values are lists of elements.
int result = 0;
for (Map.Entry<T, List<U>> entry : map.entrySet())
 result += entry.getValue().size();
return result;


AltStyle によって変換されたページ (->オリジナル) /