public Map<String,Object> flattenAsMap(){
  if (flattenedMap != null)   return flattenedMap;
  flattenedMap=newJsonifyLinkedHashMap();
  reduce(source);
  while (!elementIters.isEmpty()) {
    IndexedPeekIterator<?> deepestIter=elementIters.getLast();
    if (!deepestIter.hasNext()) {
      elementIters.removeLast();
    }
 else     if (deepestIter.peek() instanceof Member) {
      Member mem=(Member)deepestIter.next();
      reduce(mem.getValue());
    }
 else {
      JsonValue val=(JsonValue)deepestIter.next();
      reduce(val);
    }
  }
  return flattenedMap;
}

public Map < String , Object > flattenAsMap ( ) { if ( flattenedMap != null ) return flattenedMap ; flattenedMap = newJsonifyLinkedHashMap ( ) ; reduce ( source ) ; while ( ! elementIters . isEmpty ( ) ) { IndexedPeekIterator < ? > deepestIter = elementIters . getLast ( ) ; if ( ! deepestIter . hasNext ( ) ) { elementIters . removeLast ( ) ; } else if ( deepestIter . peek ( ) instanceof Member ) { Member mem = ( Member ) deepestIter . next ( ) ; reduce ( mem . getValue ( ) ) ; } else { JsonValue val = ( JsonValue ) deepestIter . next ( ) ; reduce ( val ) ; } } return flattenedMap ; }
returns a flattened json as map .
