From 4f3559d20d1192f7a43bfc7e91f84222cfa15471 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Wed, 7 Jul 2004 20:15:07 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'cdt_2_0'. Cherrypick from master 2004-07-07 20:15:06 UTC Andrew Niefer 'Refactoring pst.TypeInfo for memory performance. see parser.changelog': core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateParameterTypeInfo.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMatch.java --- .../parser/pst/TemplateParameterTypeInfo.java | 36 +++++++++++++++++ .../cdt/internal/ui/search/CSearchMatch.java | 39 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateParameterTypeInfo.java create mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMatch.java diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateParameterTypeInfo.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateParameterTypeInfo.java new file mode 100644 index 00000000000..17a0041eaae --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateParameterTypeInfo.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +/* + * Created on Jul 5, 2004 + */ +package org.eclipse.cdt.internal.core.parser.pst; + +/** + * @author aniefer + */ +public class TemplateParameterTypeInfo extends TypeInfo { + + public ITypeInfo.eType getTemplateParameterType() { + return _templateParameterType; + } + public void setTemplateParameterType( ITypeInfo.eType type ) { + _templateParameterType = type; + } + public boolean equals( Object t ) { + if( !super.equals( t ) ){ + return false; + } + return _templateParameterType == ((ITypeInfo)t).getTemplateParameterType(); + } + + private ITypeInfo.eType _templateParameterType = t_typeName; +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMatch.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMatch.java new file mode 100644 index 00000000000..3f04195a512 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMatch.java @@ -0,0 +1,39 @@ +/* + * Created on Jun 27, 2004 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.eclipse.cdt.internal.ui.search; + +import org.eclipse.cdt.core.search.BasicSearchMatch; +import org.eclipse.cdt.core.search.IMatch; +import org.eclipse.search.ui.text.Match; + +/** + * @author bgheorgh + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class CSearchMatch extends Match { + + private BasicSearchMatch searchMatch; + /** + * @param element + * @param offset + * @param length + */ + public CSearchMatch(Object element, int offset, int length, IMatch match) { + super(element, offset, length); + if (match instanceof BasicSearchMatch) + searchMatch = (BasicSearchMatch)match; + } + + /** + * @return Returns the searchMatch. + */ + public BasicSearchMatch getSearchMatch() { + return searchMatch; + } +}