001/* 002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others 003 * 004 * This program and the accompanying materials are made available under the 005 * terms of the Eclipse Public License 2.0 which is available at 006 * http://www.eclipse.org/legal/epl-2.0. 007 * 008 * SPDX-License-Identifier: EPL-2.0 009 */ 010 011package gololang.ir; 012 013/** 014 * Interface for elements that contains local references. 015 */ 016public interface ReferencesHolder { 017 018 /** 019 * Returns the references contained in this element. 020 */ 021 LocalReference[] getReferences(); 022 023 /** 024 * Returns the number of references contained in this element. 025 */ 026 default int getReferencesCount() { 027 return getReferences().length; 028 } 029 030 /** 031 * Returns only the declaring references. 032 */ 033 default LocalReference[] getDeclaringReferences() { 034 return getReferences(); 035 } 036}