~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroEntry.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2007, 2008 Intel Corporation and others.
 
3
 * All rights reserved. This program and the accompanying materials
 
4
 * are made available under the terms of the Eclipse Public License v1.0
 
5
 * which accompanies this distribution, and is available at
 
6
 * http://www.eclipse.org/legal/epl-v10.html
 
7
 *
 
8
 * Contributors:
 
9
 * Intel Corporation - Initial API and implementation
 
10
 *******************************************************************************/
 
11
package org.eclipse.cdt.core.settings.model;
 
12
 
 
13
 
 
14
 
 
15
public final class CMacroEntry extends ACSettingEntry implements ICMacroEntry{
 
16
        private String fValue;
 
17
 
 
18
        public CMacroEntry(String name, String value, int flags) {
 
19
                super(name, flags);
 
20
                fValue = value;
 
21
                if(fValue == null)
 
22
                        fValue = "";    //$NON-NLS-1$
 
23
        }
 
24
 
 
25
        @Override
 
26
        public String getValue() {
 
27
                return fValue;
 
28
        }
 
29
 
 
30
        public final int getKind() {
 
31
                return MACRO;
 
32
        }
 
33
 
 
34
        @Override
 
35
        public boolean equals(Object other) {
 
36
                if(!super.equals(other))
 
37
                        return false;
 
38
                return fValue.equals(((CMacroEntry)other).fValue);
 
39
        }
 
40
 
 
41
        @Override
 
42
        public int hashCode() {
 
43
                return super.hashCode() + fValue.hashCode();
 
44
        }
 
45
 
 
46
        @Override
 
47
        public boolean equalsByContents(ICSettingEntry entry) {
 
48
                if(!super.equalsByContents(entry))
 
49
                        return false;
 
50
                
 
51
                return fValue.equals(((CMacroEntry)entry).fValue);
 
52
        }
 
53
 
 
54
        @Override
 
55
        protected String contentsToString() {
 
56
                return new StringBuffer().append(fName).append('=').append(fValue).toString();
 
57
        }
 
58
        
 
59
}