@Override public Object get( int index ) { Object obj = list.get( index ); if ( obj instanceof Value ) { obj = convert( ( Value ) obj ); list.set( index, obj ); } chopIfNeeded( obj ); return obj; }
private void chopIfNeeded( Object object ) { if ( lazyChop ) { if ( object instanceof LazyValueMap ) { LazyValueMap m = ( LazyValueMap ) object; m.chopMap(); } else if ( object instanceof ValueList ) { ValueList list = ( ValueList ) object; list.chopList(); } } }
@Override public Iterator<Object> iterator() { convertAllIfNeeded(); return list.iterator(); }
list = new ArrayList<> (); } else { list = new ValueList ( lazyChop );
collectionOfValues = ( ( ValueList ) collectionOfValues ).list();
private void convertAllIfNeeded() { if ( !converted ) { converted = true; for ( int index = 0; index < list.size(); index++ ) { this.get( index ); } } }
public void chopList() { for ( Object obj : list ) { if ( obj == null ) continue; if ( obj instanceof Value ) { Value value = ( Value ) obj; if ( value.isContainer() ) { chopContainer( value ); } else { value.chop(); } } } }
list = new ArrayList<> (); } else { list = new ValueList ( lazyChop );
collectionOfValues = ( ( ValueList ) collectionOfValues ).list();
private void convertAllIfNeeded() { if ( !converted ) { converted = true; for ( int index = 0; index < list.size(); index++ ) { this.get( index ); } } }
public void chopList() { for ( Object obj : list ) { if ( obj == null ) continue; if ( obj instanceof Value ) { Value value = ( Value ) obj; if ( value.isContainer() ) { chopContainer( value ); } else { value.chop(); } } } }
list = new ArrayList<> (); } else { list = new ValueList ( lazyChop );
private void chopIfNeeded( Object object ) { if ( lazyChop ) { if ( object instanceof LazyValueMap ) { LazyValueMap m = ( LazyValueMap ) object; m.chopMap(); } else if ( object instanceof ValueList ) { ValueList list = ( ValueList ) object; list.chopList(); } } }
@Override public Object get( int index ) { Object obj = list.get( index ); if ( obj instanceof Value ) { obj = convert( ( Value ) obj ); list.set( index, obj ); } chopIfNeeded( obj ); return obj; }
public ListIterator<Object> listIterator() { convertAllIfNeeded(); return list.listIterator(); }
collectionOfValues = ( ( ValueList ) collectionOfValues ).list();
list = new ArrayList<>(); } else { list = new ValueList ( lazyChop );
/** If in lazy chop mode, and the object is a Lazy Value Map or a ValueList * then we force a chop operation for each of its items. */ private void lazyChopIfNeeded( Object object ) { if ( lazyChop ) { if ( object instanceof LazyValueMap ) { LazyValueMap m = ( LazyValueMap ) object; m.chopMap(); } else if ( object instanceof ValueList ) { ValueList list = ( ValueList ) object; list.chopList(); } } }
@Override public Iterator<Object> iterator() { convertAllIfNeeded(); return list.iterator(); }
collectionOfValues = ( ( ValueList ) collectionOfValues ).list();