jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java
author never
Mon, 12 Jul 2010 22:27:18 -0700
changeset 5926 a36f90d986b6
parent 5506 202f599c92aa
child 22260 c9185e010e03
permissions -rw-r--r--
6968385: malformed xml in sweeper logging Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.print;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.OutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.util.ArrayList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.Iterator;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.print.DocFlavor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import sun.awt.AppContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.util.ServiceLoader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.util.ServiceConfigurationError;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * A <code>StreamPrintServiceFactory</code> is the factory for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * {@link StreamPrintService} instances,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * which can print to an output stream in a particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * document format described as a mime type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * A typical output document format may be Postscript(TM).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * This class is implemented by a service and located by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * implementation using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <a href="../../../technotes/guides/jar/jar.html#Service Provider">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * SPI JAR File specification</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * Applications locate instances of this class by calling the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * {@link #lookupStreamPrintServiceFactories(DocFlavor, String)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * Applications can use a <code>StreamPrintService</code> obtained from a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * factory in place of a <code>PrintService</code> which represents a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * physical printer device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
public abstract class StreamPrintServiceFactory {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    static class Services {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        private ArrayList listOfFactories = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    private static Services getServices() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        Services services =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            (Services)AppContext.getAppContext().get(Services.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        if (services == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            services = new Services();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            AppContext.getAppContext().put(Services.class, services);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        return services;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    private static ArrayList getListOfFactories() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        return getServices().listOfFactories;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    private static ArrayList initListOfFactories() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        ArrayList listOfFactories = new ArrayList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        getServices().listOfFactories = listOfFactories;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        return listOfFactories;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Locates factories for print services that can be used with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * a print job to output a stream of data in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * format specified by {@code outputMimeType}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * The {@code outputMimeType} parameter describes the document type that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * you want to create, whereas the {@code flavor} parameter describes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * format in which the input data will be provided by the application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * to the {@code StreamPrintService}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * Although null is an acceptable value to use in the lookup of stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * printing services, it's typical to search for a particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * desired format, such as Postscript(TM).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @param flavor of the input document type - null means match all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @param outputMimeType representing the required output format, used to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * identify suitable stream printer factories. A value of null means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * match all formats.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @return - matching factories for stream print service instance,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *           empty if no suitable factories could be located.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     public static StreamPrintServiceFactory[]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
         lookupStreamPrintServiceFactories(DocFlavor flavor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                                           String outputMimeType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
         ArrayList list = getFactories(flavor, outputMimeType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
         return (StreamPrintServiceFactory[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
               (list.toArray(new StreamPrintServiceFactory[list.size()]));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    /** Queries the factory for the document format that is emitted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * by printers obtained from this factory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @return the output format described as a mime type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public abstract String getOutputFormat();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * Queries the factory for the document flavors that can be accepted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * by printers obtained from this factory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @return array of supported doc flavors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public abstract DocFlavor[] getSupportedDocFlavors();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * Returns a <code>StreamPrintService</code> that can print to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * the specified output stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * The output stream is created and managed by the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * It is the application's responsibility to close the stream and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * to ensure that this Printer is not reused.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * The application should not close this stream until any print job
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * created from the printer is complete. Doing so earlier may generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * a <code>PrinterException</code> and an event indicating that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * job failed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Whereas a <code>PrintService</code> connected to a physical printer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * can be reused,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * a <code>StreamPrintService</code> connected to a stream cannot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * The underlying <code>StreamPrintService</code> may be disposed by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * the print system with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * the {@link StreamPrintService#dispose() dispose} method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * before returning from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * {@link DocPrintJob#print(Doc, javax.print.attribute.PrintRequestAttributeSet) print}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * method of <code>DocPrintJob</code> so that the print system knows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * this printer is no longer usable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * This is equivalent to a physical printer going offline - permanently.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * Applications may supply a null print stream to create a queryable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * service. It is not valid to create a PrintJob for such a stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * Implementations which allocate resources on construction should examine
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * the stream and may wish to only allocate resources if the stream is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * non-null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @param out destination stream for generated output.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @return a PrintService which will generate the format specified by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * DocFlavor supported by this Factory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    public abstract StreamPrintService getPrintService(OutputStream out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    private static ArrayList getAllFactories() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        synchronized (StreamPrintServiceFactory.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
          ArrayList listOfFactories = getListOfFactories();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            if (listOfFactories != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                return listOfFactories;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                listOfFactories = initListOfFactories();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                java.security.AccessController.doPrivileged(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                     new java.security.PrivilegedExceptionAction() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                        public Object run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                            Iterator<StreamPrintServiceFactory> iterator =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                                ServiceLoader.load
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                                (StreamPrintServiceFactory.class).iterator();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                            ArrayList lof = getListOfFactories();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                            while (iterator.hasNext()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                                    lof.add(iterator.next());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                                }  catch (ServiceConfigurationError err) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                                     /* In the applet case, we continue */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                                    if (System.getSecurityManager() != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                                        err.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                                    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                                        throw err;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            } catch (java.security.PrivilegedActionException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            return listOfFactories;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    private static boolean isMember(DocFlavor flavor, DocFlavor[] flavors) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        for (int f=0; f<flavors.length; f++ ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            if (flavor.equals(flavors[f])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    private static ArrayList getFactories(DocFlavor flavor, String outType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        if (flavor == null && outType == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            return getAllFactories();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        ArrayList list = new ArrayList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        Iterator iterator = getAllFactories().iterator();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        while (iterator.hasNext()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            StreamPrintServiceFactory factory =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                (StreamPrintServiceFactory)iterator.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            if ((outType == null ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                 outType.equalsIgnoreCase(factory.getOutputFormat())) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                (flavor == null ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                 isMember(flavor, factory.getSupportedDocFlavors()))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                list.add(factory);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        return list;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
}