Comments from code review with Ashish, Raghu, and Namit:
1. Move factory methods in LazyUtils to LazyFactory;
2. LazyArray etc should use Factory methods (with TypeInfo as parameter) to create elements;
3. Comment that LazySimpleSerDe only supports 10 levels of separators currently.
4. Use a global pointer to byte, and all LazyObjects should point to the global pointer.
This helps with garbage collection.
5. More Javadoc.
6. Move the 3 fields (bytes, start, length) from LazyNonPrimitive to LazyObject, add "parsed" to LazyPrimitive.
This makes the code cleaner because all LazyObjects now behave in the same way - nothing happens in setAll (but cached the values), and actual parsing happens later.
The trade-off is that LazyPrimitive takes more memory - 12 bytes for bytes, start, and length.
For 6, a better way would be to always directly parse the data when "setAll" is called (basically, convert the way LazyNonPrimitive works to the way that LazyPrimitive works.) The reason is that there is no point of "setAll" if we don't need to parse the data later, so why don't we directly parse the data in the "setAll" call?