Package org.rascalmpl.library.experiments.resource.results

Source Code of org.rascalmpl.library.experiments.resource.results.LineStreamResult

/*******************************************************************************
* Copyright (c) 2009-2013 CWI
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.rascalmpl.library.experiments.resource.results;

import java.net.URI;

import org.eclipse.imp.pdb.facts.ISourceLocation;
import org.eclipse.imp.pdb.facts.IValue;
import org.eclipse.imp.pdb.facts.type.Type;
import org.rascalmpl.interpreter.IEvaluatorContext;
import org.rascalmpl.interpreter.result.ResourceResult;
import org.rascalmpl.library.experiments.resource.results.buffers.LazyList;
import org.rascalmpl.library.experiments.resource.results.buffers.LineStreamFiller;
import org.rascalmpl.uri.URIUtil;
import org.rascalmpl.values.ValueFactoryFactory;

public class LineStreamResult extends ResourceResult {

  public LineStreamResult(Type type, IValue value, IEvaluatorContext ctx, ISourceLocation fullURI, String displayURI) {
    super(type, value, ctx, fullURI, displayURI);
    String str = fullURI.getURI().getPath();
    String newHost = str.substring(1,str.indexOf("/",1));
    String newPath = str.substring(str.indexOf("/",1)+1);
    URI uri = URIUtil.assumeCorrect(newHost, "", newPath);
    this.value = new LazyList(25, new LineStreamFiller(ValueFactoryFactory.getValueFactory().sourceLocation(uri), ctx), type.getElementType());
  }

}
TOP

Related Classes of org.rascalmpl.library.experiments.resource.results.LineStreamResult

TOP
Copyright © 2018 www.massapi.com. 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.