Java ListIterator Usage toCFML(Object obj)

Here you can find the source of toCFML(Object obj)

Description

to CFML

License

LGPL

Declaration

public static Object toCFML(Object obj) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;

public class Main {
    public static Object toCFML(Object obj) {
        if (obj instanceof Map)
            return toCFML((Map) obj);
        if (obj instanceof List)
            return toCFML((List) obj);
        return obj;
    }/*  ww w  .ja  va2 s.c  om*/

    public static Map toCFML(Map map) {
        Iterator it = map.entrySet().iterator();
        Map.Entry entry;
        while (it.hasNext()) {
            entry = (Entry) it.next();
            entry.setValue(toCFML(entry.getValue()));
        }
        return map;
    }

    public static Object toCFML(List list) {
        ListIterator it = list.listIterator();
        int index;
        while (it.hasNext()) {
            index = it.nextIndex();
            list.set(index, toCFML(it.next()));

        }
        return list;
    }
}

Related

  1. sort(List aList)
  2. stringCrossJoin(List> candidates)
  3. stringToList(String commas)
  4. stripQuotes(List input)
  5. toArray(List a)
  6. toCharArrays(List strings)
  7. toInt(final List digits, final int base)
  8. toIntegerArray(List list)
  9. toLowerCase(List list)