<commit_before>/*******************************************************************************
* Copyright (c) 2007 IBM Corporation.
* 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
*
* Contributors:
*    <NAME> (<EMAIL>) - initial API and implementation

*******************************************************************************/

package org.eclipse.imp.pdb.facts;

import java.net.URI;

/**
 * Source locations point to (parts of) files that contain source code.
 * Technically, the contents of the file does not have to be source code per se.
 * <br>
 * The part of the file is indicated by a character offset and length, as well as a
 * line and column region. The reason for the redundancy is that each representation
 * can not be computed from the other without processing the entire file. 
 * The goal of this representation is to allow different kinds and implementations
 * of tools, such as editors, to easily jump to source locations. 
 */
public interface ISourceLocation extends IValue {
	/**
	 * @return exact url where the source is located. The particular encoding of
	 * the URL is not specified.
	 */
    URI getURI();

    String getScheme();
	String getAuthority() throws UnsupportedOperationException;
	String getPath() throws UnsupportedOperationException;
	String getFragment() throws UnsupportedOperationException;
	String getQuery() throws UnsupportedOperationException;
	Boolean hasAuthority();
	Boolean hasPath();
	Boolean hasFragment();
	Boolean hasQuery();
    
    
    /**
     * @return true iff the source location has offset/length information stored with it.
     */
    public boolean hasOffsetLength();
    <commit_msg>Added warning on the getURI method, almost wanted to deprecate it<commit_after>/*******************************************************************************
* Copyright (c) 2007 IBM Corporation.
* 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
*
* Contributors:
*    <NAME> (rfuhr<EMAIL>) - initial API and implementation

*******************************************************************************/

package org.eclipse.imp.pdb.facts;

import java.net.URI;

/**
 * Source locations point to (parts of) files that contain source code.
 * Technically, the contents of the file does not have to be source code per se.
 * <br>
 * The part of the file is indicated by a character offset and length, as well as a
 * line and column region. The reason for the redundancy is that each representation
 * can not be computed from the other without processing the entire file. 
 * The goal of this representation is to allow different kinds and implementations
 * of tools, such as editors, to easily jump to source locations. 
 */
public interface ISourceLocation extends IValue {
	/**
	 * The {@link #top() top} method is preferred.
	 * @return exact url where the source is located. The particular encoding of
	 * the URL is not specified.
	 */
    URI getURI();

    String getScheme();
	String getAuthority() throws UnsupportedOperationException;
	String getPath() throws UnsupportedOperationException;
	String getFragment() throws UnsupportedOperationException;
	String getQuery() throws UnsupportedOperationException;
	Boolean hasAuthority();
	Boolean hasPath();
	Boolean hasFragment();
	Boolean hasQuery();
    
    
    /**
     * @return true iff the source location has offset/length information stored with it.
     */
    public boolean hasOffsetLength();
    
{'fraction_non_alphanumeric': 0.14943732007327926, 'fraction_numerical': 0.004187385501177702, 'mean_word_length': 4.4289772727272725, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3827865', 'n_tokens_mistral': 927, 'n_tokens_neox': 871, 'n_words': 425}