Package org.terrier.indexing

Examples of org.terrier.indexing.Collection


            --start;
            _input.seek(start);
      }
      internalInputStream = inputStream = new CountingInputStream(_input, start);
    }
    Collection rtr = CollectionFactory.loadCollection(
      ApplicationSetup.getProperty("trec.collection.class", "TRECCollection"),
      new Class[]{InputStream.class},
      new Object[]{internalInputStream});

    if (rtr == null)
View Full Code Here


    }
    if (constructorValues == null)
      constructorValues = new Object[0];

    /* first load the innermost collection, ie the one that does the reading */ 
    Collection rtr = null;
    final String firstCollectionName = normaliseCollectionName(collNames[collCount-1]);
    try{
      Class<? extends Collection> collectionClass = Class.forName(firstCollectionName).asSubclass(Collection.class);
      rtr = collectionClass.getConstructor(contructorTypes).newInstance(constructorValues); //collectionClass.newInstance();
    } catch (ClassNotFoundException e) {
      logger.error("ERROR: First Collection class named "+ firstCollectionName + " not found", e);
      return null;
    } catch (NoSuchMethodException e) {
      logger.error("ERROR: First Collection class named "+ firstCollectionName + " - "+constructor+" constructor not found", e);
    } catch (Exception e) {
      logger.error("ERROR: First Collection class named "+ firstCollectionName + "  - cannot be instantiated", e);
            return null;
        }

    /* now load any wrapper collections requested */
    int i = collCount-2;
    if (collCount>1)
    try{
      for(;i>=0;i--)
      {
        Collection newColl = Class.forName(normaliseCollectionName(collNames[i]))
          .asSubclass(Collection.class)
          .getConstructor(new Class[]{Collection.class})
                  .newInstance(new Object[]{rtr})
        rtr = newColl;
      }
View Full Code Here

TOP

Related Classes of org.terrier.indexing.Collection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.