6
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Intel Corporation - Initial API and implementation
9
* Intel Corporation - Initial API and implementation
10
10
*******************************************************************************/
11
11
package org.eclipse.cdt.core.settings.model;
17
17
private final int fFlags;
18
18
private final String fName;
20
ACSettingEntry(String name, int flags){
20
ACSettingEntry(String name, int flags) {
21
21
fName = SafeStringInterner.safeIntern(name);
91
92
return equalsByName(entry);
94
protected int getByNameMatchFlags(){
95
return (fFlags & (~ (BUILTIN | READONLY | RESOLVED)));
95
protected int getByNameMatchFlags() {
96
return fFlags & ~(BUILTIN | READONLY | RESOLVED);
99
100
public final boolean equalsByName(ICSettingEntry entry) {
103
if(!(entry instanceof ACSettingEntry))
104
if (!(entry instanceof ACSettingEntry))
106
107
ACSettingEntry e = (ACSettingEntry)entry;
108
if(getKind() != e.getKind())
109
if (getKind() != e.getKind())
111
if(getByNameMatchFlags()
112
if (getByNameMatchFlags()
112
113
!= e.getByNameMatchFlags())
115
if(!fName.equals(e.fName))
116
if (!fName.equals(e.fName))
121
public final int codeForNameKey(){
122
public final int codeForNameKey() {
122
123
return getKind() + getByNameMatchFlags() + fName.hashCode();
125
public int codeForContentsKey(){
126
public int codeForContentsKey() {
126
127
return codeForNameKey();
130
public final String toString(){
131
StringBuffer buf = new StringBuffer();
131
public final String toString() {
132
StringBuilder buf = new StringBuilder();
132
133
buf.append('[').append(LanguageSettingEntriesSerializer.kindToString(getKind())).append(']').append(' ');
133
134
buf.append(contentsToString());
134
buf.append(" ; flags: ").append(LanguageSettingEntriesSerializer.composeFlagsString(getFlags())); //$NON-NLS-1$
135
buf.append("; flags: ").append(LanguageSettingEntriesSerializer.composeFlagsString(getFlags())); //$NON-NLS-1$
135
136
return buf.toString();
138
139
protected abstract String contentsToString();