Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.impl / src / main / java / org / gvsig / fmap / dal / feature / paging / impl / FeaturePagingHelperImpl.java @ 43726

History | View | Annotate | Download (28 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.fmap.dal.feature.paging.impl;
25

    
26
import java.util.ArrayList;
27
import java.util.Collection;
28
import java.util.Date;
29
import java.util.Iterator;
30
import java.util.List;
31
import java.util.ListIterator;
32
import org.slf4j.Logger;
33
import org.slf4j.LoggerFactory;
34

    
35
import org.gvsig.fmap.dal.exception.DataException;
36
import org.gvsig.fmap.dal.feature.EditableFeature;
37
import org.gvsig.fmap.dal.feature.Feature;
38
import org.gvsig.fmap.dal.feature.FeatureQuery;
39
import org.gvsig.fmap.dal.feature.FeatureSelection;
40
import org.gvsig.fmap.dal.feature.FeatureSet;
41
import org.gvsig.fmap.dal.feature.FeatureStore;
42
import org.gvsig.fmap.dal.feature.FeatureType;
43
import org.gvsig.fmap.dal.feature.exception.ConcurrentDataModificationException;
44
import org.gvsig.fmap.dal.feature.exception.FeatureIndexException;
45
import org.gvsig.fmap.dal.feature.impl.dynobjectutils.DynObjectFeatureFacade;
46
import org.gvsig.fmap.dal.feature.paging.FacadeOfAFeaturePagingHelper;
47
import org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper;
48
import org.gvsig.tools.dynobject.DynObject;
49
import org.gvsig.tools.dynobject.DynObjectSet;
50
import org.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper;
51
import org.gvsig.tools.exception.BaseException;
52
import org.gvsig.tools.visitor.VisitCanceledException;
53
import org.gvsig.tools.visitor.Visitor;
54

    
55
/**
56
 * Helper class to access the values of a FeatureCollection by position. Handles
57
 * pagination automatically to avoid filling the memory in case of big
58
 * collections.
59
 *
60
 * TODO: evaluate if its more convenient to read values in the background when
61
 * the returned value is near the end of the page, instead of loading a page on
62
 * demand.
63
 *
64
 * @author gvSIG Team
65
 */
66
public class FeaturePagingHelperImpl extends DefaultDynObjectPagingHelper
67
    implements FeaturePagingHelper {
68

    
69
    private static final Logger LOG = LoggerFactory.getLogger(FeaturePagingHelperImpl.class);
70

    
71
    private static class Page {
72

    
73
        private Feature[] features;
74
        private final long number;
75
        private final int size;
76
        private long lastaccess;
77
        
78
        public Page(long number, int size) {
79
            this.size = size;
80
            this.number = number;
81
            this.features = new Feature[size];
82
            this.lastaccess = 0;
83
        }
84

    
85
        public void setFeature(int i, Feature copy) {
86
            this.features[i] = copy;
87
        }
88
        
89
        public Feature[] getFeatures() {
90
            this.lastaccess = (new Date()).getTime();
91
            return this.features;
92
        }
93
        
94
        public long getPageNumber() {
95
            return this.number;
96
        }
97
        
98
        public long getLastAccess() {
99
            return this.lastaccess;
100
        }
101
        
102
        public int size() {
103
            return this.size;
104
        }
105
        
106
        public void dispose() {
107
            for (int i = 0; i < features.length; i++) {
108
                features[i] = null;
109
            }
110
            this.features = null;
111
            this.lastaccess = 0;
112
        }
113
    } 
114
    
115
    private static class PageCache {
116

    
117
        private final int maxpages;
118
        private List<Page> pages;
119
        
120
        public PageCache(int maxpages) {
121
            this.maxpages = maxpages;
122
            this.pages = new ArrayList<>();
123
        }
124
        
125
        public void clear() {
126
            for (Page page : pages) {
127
                page.dispose();
128
            }
129
            this.pages = new ArrayList<>();    
130
        }
131
        
132
        public Page get(long pageNumber) {
133
            for( Page page : pages ) {
134
                if( page.getPageNumber() == pageNumber ) {
135
                    return page;
136
                }
137
            }
138
            return null;
139
        }
140
        
141
        public void add(Page page) {
142
            if( this.pages.size()< this.maxpages ) {
143
                this.pages.add(page);
144
                return;
145
            }
146
            int toDrop = 0;
147
            for( int i=0; i<this.pages.size(); i++ ) {
148
                if( this.pages.get(i).getLastAccess()<this.pages.get(toDrop).getLastAccess() ) {
149
                    toDrop = i;
150
                }
151
            }
152
            this.pages.set(toDrop, page);
153
        }
154
    }
155
    
156
    private FeatureQuery query;
157

    
158
    private FeatureStore featureStore;
159

    
160
    /** If the selected Features must be returned as the first ones. **/
161
    private boolean selectionUp = false;
162

    
163
    private FeatureSet featSet = null;
164
    private FeatureSelection initialSelection = null;
165

    
166
    private Feature[] features = null;
167
    private PageCache cachedPages = null;
168

    
169
    private boolean initialization_completed = false;
170

    
171
    private FeatureSelection selection = null;
172
    /**
173
     * Constructs a FeaturePagingHelperImpl from data of a FeatureStore.
174
     *
175
     * @param featureStore
176
     *            to extract data from
177
     * @throws DataException
178
     *             if there is an error initializing the helper
179
     */
180
    public FeaturePagingHelperImpl(FeatureStore featureStore)
181
        throws BaseException {
182
        this(featureStore, DEFAULT_PAGE_SIZE);
183
    }
184

    
185
    /**
186
     * Constructs a FeaturePagingHelperImpl from data of a FeatureStore.
187
     *
188
     * @param featureStore
189
     *            to extract data from
190
     * @param pageSize
191
     *            the number of elements per page data
192
     * @throws DataException
193
     *             if there is an error initializing the helper
194
     */
195
    public FeaturePagingHelperImpl(FeatureStore featureStore, int pageSize)
196
        throws BaseException {
197
        this(featureStore, null, pageSize);
198
    }
199

    
200
    /**
201
     * Constructs a FeaturePagingHelperImpl from data of a FeatureStore.
202
     *
203
     * @param featureStore
204
     *            to extract data from
205
     * @throws DataException
206
     *             if there is an error initializing the helper
207
     */
208
    public FeaturePagingHelperImpl(FeatureStore featureStore,
209
        FeatureQuery featureQuery) throws BaseException {
210
        this(featureStore, featureQuery, DEFAULT_PAGE_SIZE);
211
    }
212

    
213
    /**
214
     * Constructs a FeaturePagingHelperImpl from data of a FeatureStore.
215
     *
216
     * @param featureSet
217
     *            to extract data from
218
     * @param pageSize
219
     *            the number of elements per page data
220
     * @throws DataException
221
     *             if there is an error initializing the helper
222
     */
223
    public FeaturePagingHelperImpl(FeatureStore featureStore,
224
        FeatureQuery featureQuery, int pageSize) throws BaseException {
225
        super();
226
        this.cachedPages = new PageCache(3);
227
        FeatureQuery query = featureQuery;
228
        if (featureQuery == null) {
229
            query = featureStore.createFeatureQuery();
230
            query.setFeatureType(featureStore.getDefaultFeatureType());
231
        }
232

    
233
        this.featureStore = featureStore;
234
        this.query = query;
235
        this.query.setPageSize(pageSize);
236

    
237
        setDefaultCalculator(new Sizeable() {
238
            public long getSize() {
239
                    FeatureSet featureSet = getFeatureSet(false);
240
                try {
241
                                        return featureSet.getSize();
242
                } catch (BaseException e) {
243
                    LOG.error("Error getting the size of the FeatureSet: "
244
                        + featureSet, e);
245
                    return 0l;
246
                }
247
            }
248
        }, pageSize);
249

    
250

    
251
        if (LOG.isDebugEnabled()) {
252

    
253
            LOG.debug("FeaturePagingHelperImpl created with {} pages, "
254
                + "and a page size of {}", new Long(getCalculator()
255
                .getNumPages()), new Integer(pageSize));
256
        }
257
        this.initialization_completed = true;
258
    }
259

    
260
    /**
261
     * @return the selectionUp status
262
     */
263
    public boolean isSelectionUp() {
264
        return selectionUp;
265
    }
266
    
267
    public FeatureSelection getSelection() {
268
        if (selection == null) {
269
            try {
270
                return getFeatureStore().getFeatureSelection();
271
            } catch (Exception e) {
272
                LOG.warn("Error getting the selection", e);
273
            }
274
        }
275
        return selection;
276
    }
277
    
278
    public void setSelection(FeatureSelection selection) {
279
        this.selection = selection;
280
    }
281
    
282
    @Override
283
    public void setSelectionUp(boolean selectionUp) {
284
        this.selectionUp = selectionUp;
285
        try {
286
            FeatureSelection currentSelection = getSelection();
287
            if (selectionUp && !currentSelection.isEmpty()) {
288
                initialSelection =(FeatureSelection) currentSelection.clone();
289
                setCalculator(new OneSubsetOneSetPagingCalculator(
290
                    new FeatureSetSizeableDelegate(initialSelection),
291
                    new FeatureSetSizeableDelegate(getFeatureSet(false)),
292
                    getMaxPageSize()));
293
            } else {
294
                if (initialSelection != null) {
295
                    initialSelection.dispose();
296
                    initialSelection = null;
297
                }
298
                setDefaultCalculator(new FeatureSetSizeableDelegate(
299
                    getFeatureSet(false)), getMaxPageSize());
300
            }
301
        } catch (BaseException e) {
302
            LOG.error("Error setting the selection up setting to: "
303
                + selectionUp, e);
304
        } catch (CloneNotSupportedException e) {
305
            LOG.error("Error cloning the selection "
306
                + "while setting the selection up", e);
307
        }
308
    }
309

    
310
    public synchronized Feature getFeatureAt(long index) throws BaseException {
311
        // Check if we have currently loaded the viewed page data,
312
        // or we need to load a new one
313
            int maxPageSize = getMaxPageSize();
314
            long currentPage = getCurrentPage();
315
            long currentPage2 = currentPage;
316
            
317
            
318
        long pageForIndex = (long) Math.floor(index / maxPageSize);
319

    
320
        if (pageForIndex != currentPage) {
321
            setCurrentPage(pageForIndex);
322
            currentPage2 = getCurrentPage();
323
        }
324

    
325
        long positionForIndex = index - (currentPage2 * maxPageSize);
326

    
327
        if (positionForIndex >= getCurrentPageFeatures().length) {
328
            throw new FeatureIndexException(
329
                new IndexOutOfBoundsException("positionForIndex too big: "
330
                    + positionForIndex));
331
        } else {
332
            Feature feature = getCurrentPageFeatures()[(int) positionForIndex];
333
            return feature;
334
        }
335

    
336
    }
337

    
338
    public Feature[] getCurrentPageFeatures() {
339
        if( this.features==null ) {
340
            try {
341
                this.loadCurrentPageData();
342
            } catch (BaseException ex) {
343
                // Do nothing
344
            }
345
            if( this.features == null ) {
346
                String msg = "Can't retrieve the features from current page.";
347
                LOG.warn(msg);
348
                throw new RuntimeException(msg);
349
            }
350
        }
351
        return features;
352
    }
353

    
354
    /**
355
     * Gets the feature set.
356
     * The boolean tells whether we must create the featureset
357
     * again (for example perhaps we need it after a feature
358
     * has been added/removed)
359
     */
360
    private FeatureSet getFeatureSet(boolean reset) {
361

    
362
        if (featSet == null || reset) {
363

    
364
            if (featSet != null) {
365
                try {
366
                    featSet.dispose();
367
                } catch (Exception ex) {
368
                    LOG.info("Error while disposing featset.", ex);
369
                }
370
            }
371

    
372
            try {
373
                FeatureStore featureStore = getFeatureStore();
374
                synchronized (featureStore) {
375
                    featSet = featureStore.getFeatureSet(getFeatureQuery());
376
                }
377
            } catch (DataException e) {
378
                throw new RuntimeException("Error getting a feature set with the query " + getFeatureQuery());
379
            }
380
        }
381
        return featSet;
382
    }
383

    
384
    @Override
385
    public DynObjectSet getDynObjectSet() {
386
            return getFeatureSet(false).getDynObjectSet();
387
    }
388

    
389
    @Override
390
    public void reloadCurrentPage() throws BaseException {
391

    
392
        boolean sel_up = this.isSelectionUp();
393

    
394
        setSelectionUp(false);
395
        if (getCalculator().getCurrentPage() > -1) {
396
            this.cachedPages.clear();
397
            loadCurrentPageData();
398
        }
399

    
400
        if (sel_up) {
401
            setSelectionUp(true);
402
        }
403
    }
404

    
405
    @Override
406
    public void reload() throws BaseException {
407

    
408
        this.cachedPages.clear();
409
        /*
410
         * Force re-creation of feature set
411
         */
412
        this.getFeatureSet(true);
413

    
414

    
415
        setDefaultCalculator(new Sizeable() {
416
            public long getSize() {
417
                    FeatureSet featureSet = getFeatureSet(false);
418
                try {
419
                                        return featureSet.getSize();
420
                } catch (BaseException e) {
421
                    LOG.error("Error getting the size of the FeatureSet: "
422
                        + featureSet, e);
423
                    return 0l;
424
                }
425
            }
426
        }, getCalculator().getMaxPageSize());
427
        reloadCurrentPage();
428
    }
429

    
430
    public FeatureStore getFeatureStore() {
431
        return featureStore;
432
    }
433

    
434
    public FeatureQuery getFeatureQuery() {
435
        return query;
436
    }
437

    
438
    /**
439
     * Loads all the Features of the current page.
440
     * @throws org.gvsig.tools.exception.BaseException
441
     */
442
    @Override
443
    protected synchronized void loadCurrentPageData() throws BaseException {
444
        if( !initialization_completed ) {
445
            return;
446
        }
447
        final int currentPageSize = getCalculator().getCurrentPageSize();
448
        final long currentPage = getCalculator().getCurrentPage();
449
        Page page = this.cachedPages.get(currentPage);
450
        if( page==null ) {
451
            page = new Page(currentPage, currentPageSize);
452

    
453
            long t1 = 0;
454
            if (LOG.isTraceEnabled()) {
455
                t1 = System.currentTimeMillis();
456
            }
457

    
458
            if (selectionUp) {
459
                loadCurrentPageDataWithSelectionUp(page);
460
            } else {
461
                loadCurrentPageDataNoSelection(page);
462
            }
463

    
464
            if (LOG.isTraceEnabled()) {
465
                long t2 = System.currentTimeMillis();
466
                LOG.trace("Time to load {} features: {} ms", currentPageSize, t2 - t1);
467
            }
468
            this.cachedPages.add(page);
469
        }
470
        this.features = page.getFeatures();
471
    }
472

    
473
    private void loadCurrentPageDataWithSelectionUp(final Page page)
474
            throws BaseException {
475
        FeatureSelection selection = initialSelection;
476
        if (selection == null) {
477
            loadCurrentPageDataNoSelection(page);
478
        } else {
479
            FeatureSet set = getFeatureSet(false);
480
            try {
481
                OneSubsetOneSetPagingCalculator twoSetsCalculator = null;
482
                if (getCalculator() instanceof OneSubsetOneSetPagingCalculator) {
483
                    twoSetsCalculator
484
                            = (OneSubsetOneSetPagingCalculator) getCalculator();
485
                } else {
486
                    twoSetsCalculator
487
                            = new OneSubsetOneSetPagingCalculator(
488
                                    new FeatureSetSizeableDelegate(selection),
489
                                    new FeatureSetSizeableDelegate(set),
490
                                    getMaxPageSize(), getCalculator().getCurrentPage());
491
                    setCalculator(twoSetsCalculator);
492
                }
493

    
494
                // First load values from the selection, if the current page has
495
                // elements from it
496
                if (twoSetsCalculator.hasCurrentPageAnyValuesInFirstSet()) {
497
                    loadDataFromFeatureSet(page, 0, selection,
498
                            twoSetsCalculator.getFirstSetInitialIndex(),
499
                            twoSetsCalculator.getFirstSetHowMany(), null);
500
                }
501
                // Next, load values from the FeatureSet if the current page has values
502
                // from it
503
                if (twoSetsCalculator.hasCurrentPageAnyValuesInSecondSet()) {
504
                    loadDataFromFeatureSet(
505
                            page,
506
                            // The cast will work as that size will be <= maxpagesize,
507
                            // which is an int
508
                            (int) twoSetsCalculator.getFirstSetHowMany(), set,
509
                            twoSetsCalculator.getSecondSetInitialIndex(),
510
                            twoSetsCalculator.getSecondSetHowMany(), selection);
511
                }
512
            } finally {
513
                /*
514
                 * This is the feature set
515
                 * we dont want to lose it
516
                 */
517
                // set.dispose();
518
            }
519
        }
520
    }
521

    
522
    private void loadCurrentPageDataNoSelection(final Page page)
523
        throws BaseException {
524

    
525
        long firstPosition = getCalculator().getInitialIndex();
526

    
527
        if (LOG.isDebugEnabled()) {
528
            LOG.debug("Loading {} Features starting at position {}", 
529
                getCalculator().getCurrentPageSize(), firstPosition
530
            );
531
        }
532

    
533
        FeatureSet featureSet = getFeatureSet(false);
534
        try {
535
                loadDataFromFeatureSet(page, 0, featureSet, firstPosition,
536
                                getCalculator().getCurrentPageSize(), null);
537
        } catch(DataException ex) {
538
            throw ex;
539
            // } finally {
540
                // featureSet.dispose();
541
        }
542

    
543
    }
544

    
545
    private void loadDataFromFeatureSet(final Page page,
546
        final int valuesPosition, FeatureSet set, long initialIndex,
547
        final long howMany, final FeatureSelection selectedFeaturesToSkip)
548
        throws DataException {
549

    
550
        try {
551
            set.accept(new Visitor() {
552
                private int i = valuesPosition;
553

    
554
                @Override
555
                public void visit(Object obj) throws VisitCanceledException,
556
                    BaseException {
557
                    if (i >= valuesPosition + howMany) {
558
                        throw new VisitCanceledException();
559
                    }
560
                    Feature current = (Feature) obj;
561
                    // Add the current Feature only if we don't skip selected
562
                    // features or the feature is not selected
563
                    if (selectedFeaturesToSkip == null
564
                        || !selectedFeaturesToSkip.isSelected(current)) {
565
                        try {
566
                            page.setFeature(i,current.getCopy());
567
                            i++;
568
                        } catch(Exception ex) {
569
                            // Aqui no deberia petar, pero...
570
                            // me he encontrado un caso que tenia una referencia a
571
                            // una feature seleccionada que ya no existia. No se como
572
                            // habia pasado, se habia quedado de antes guardada en el
573
                            // proyecto pero la feature ya no existia, y eso hacia que
574
                            // petase al intentar leer de disco la feature a partir
575
                            // de una referencia no valida.
576
                        }
577
                    }
578
                }
579
            }, initialIndex, howMany);
580
        } catch(VisitCanceledException ex) {
581
            // Do nothing
582
        } catch (BaseException e) {
583
            if (e instanceof DataException) {
584
                throw ((DataException) e);
585
            } else {
586
                LOG.error("Error loading the data starting at position {}",
587
                    new Long(initialIndex), e);
588
            }
589
        }
590
    }
591

    
592
    public void delete(Feature feature) throws BaseException {
593
        featureStore.delete(feature);
594
        /*
595
         * Force re-creation of feature set
596
         */
597
        this.getFeatureSet(true);
598

    
599
        reloadCurrentPage();
600
    }
601

    
602
    public void insert(EditableFeature feature) throws BaseException {
603
            featureStore.insert(feature);
604
        /*
605
         * Force re-creation of feature set
606
         */
607
        this.getFeatureSet(true);
608

    
609
        reloadCurrentPage();
610
    }
611

    
612
    public void update(EditableFeature feature) throws BaseException {
613
            featureStore.update(feature);
614
        /*
615
         * Force re-creation of feature set
616
         */
617
        this.getFeatureSet(true);
618

    
619
        reloadCurrentPage();
620
    }
621

    
622
    public FeatureType getFeatureType() {
623

    
624
        FeatureType ft = null;
625

    
626
        try {
627
            ft = featureStore.getDefaultFeatureType();
628
        } catch (DataException e) {
629
            LOG.error("Error while getting feature type: " +
630
                e.getMessage(), e);
631
        }
632
        return ft;
633

    
634
        /*
635
         *
636
        FeatureSet featureSet = getFeatureSet();
637
        try {
638
            return featureSet.getDefaultFeatureType();
639
        } finally {
640
            featureSet.dispose();
641
        }
642
        */
643

    
644

    
645
    }
646

    
647
    protected void doDispose() throws BaseException {
648
        initialSelection.dispose();
649
        if (featSet != null) {
650
            try {
651
                featSet.dispose();
652
            } catch (Exception ex) {
653
                LOG.info("Error while disposing featset.", ex);
654
            }
655
        }
656
    }
657

    
658
    public DynObject[] getCurrentPageDynObjects() {
659
        Feature[] features = getCurrentPageFeatures();
660
        DynObject[] dynobjects = new DynObject[features.length];
661
        for (int i = 0; i < dynobjects.length; i++) {
662
            dynobjects[i] = new DynObjectFeatureFacade(features[i]);
663
        }
664
        return dynobjects;
665
    }
666

    
667
    public DynObject getDynObjectAt(long index) throws BaseException {
668
        return new DynObjectFeatureFacade(getFeatureAt(index));
669
    }
670

    
671
    public List asList() {
672
        return new FeaturePagingHelperList();
673
    }
674

    
675
    public List asListOfDynObjects() {
676
        return new DynObjectPagingHelperList();
677
    }
678

    
679
    private class FeaturePagingHelperList extends PagingHelperList {
680
        public Object get(int i) {
681
            try {
682
                return getFeatureAt(i);
683
            } catch (BaseException ex) {
684
                throw  new RuntimeException(ex);
685
            }
686
        }
687
    }
688

    
689
    private class DynObjectPagingHelperList extends PagingHelperList {
690
        public Object get(int i) {
691
            try {
692
                return getDynObjectAt(i);
693
            } catch (BaseException ex) {
694
                throw  new RuntimeException(ex);
695
            }
696
        }
697

    
698
    }
699

    
700
    private abstract class PagingHelperList implements List,  FacadeOfAFeaturePagingHelper {
701

    
702
        @Override
703
        public FeaturePagingHelper getFeaturePagingHelper() {
704
            return FeaturePagingHelperImpl.this;
705
        }
706
        
707
        public int size() {
708
            try {
709
                return (int) getFeatureSet(false).getSize();
710
            } catch (DataException ex) {
711
                throw  new RuntimeException(ex);
712
            }
713
        }
714

    
715
        public boolean isEmpty() {
716
            try {
717
                return getFeatureSet(false).isEmpty();
718
            } catch (DataException ex) {
719
                throw  new RuntimeException(ex);
720
            } catch (ConcurrentDataModificationException ex) {
721
                LOG.warn(
722
                    "Error to asking about the emptiness of the store. Retrying reloading data.",
723
                    ex);
724
                try {
725
                    reload();
726
                } catch (BaseException e) {
727
                    LOG.warn("Error reloading data.", e);
728
                    throw new RuntimeException(e);
729
                }
730
                try {
731
                    return getFeatureSet(false).isEmpty();
732
                } catch (DataException e) {
733
                    LOG.warn(
734
                        "Error to asking about the emptiness of the store after reloading data.",
735
                        e);
736
                    throw new RuntimeException(e);
737
                }
738
            }
739
        }
740

    
741
        public Iterator iterator() {
742
            try {
743
                return getFeatureSet(false).fastIterator();
744
            } catch (DataException ex) {
745
                throw  new RuntimeException(ex);
746
            }
747
        }
748

    
749
        public boolean contains(Object o) {
750
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
751
        }
752

    
753
        public Object[] toArray() {
754
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
755
        }
756

    
757
        public Object[] toArray(Object[] ts) {
758
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
759
        }
760

    
761
        public boolean add(Object e) {
762
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
763
        }
764

    
765
        public boolean remove(Object o) {
766
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
767
        }
768

    
769
        public boolean containsAll(Collection clctn) {
770
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
771
        }
772

    
773
        public boolean addAll(Collection clctn) {
774
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
775
        }
776

    
777
        public boolean addAll(int i, Collection clctn) {
778
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
779
        }
780

    
781
        public boolean removeAll(Collection clctn) {
782
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
783
        }
784

    
785
        public boolean retainAll(Collection clctn) {
786
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
787
        }
788

    
789
        public void clear() {
790
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
791
        }
792

    
793
        public Object set(int i, Object e) {
794
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
795
        }
796

    
797
        public void add(int i, Object e) {
798
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
799
        }
800

    
801
        public Object remove(int i) {
802
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
803
        }
804

    
805
        public int indexOf(Object o) {
806
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
807
        }
808

    
809
        public int lastIndexOf(Object o) {
810
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
811
        }
812

    
813
        public ListIterator listIterator() {
814
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
815
        }
816

    
817
        public ListIterator listIterator(int i) {
818
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
819
        }
820

    
821
        public List subList(int i, int i1) {
822
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
823
        }
824

    
825
    }
826
}