List of usage examples for com.google.gwt.dev.util.collect HashMap HashMap
public HashMap()
From source file:cz.fi.muni.xkremser.editor.server.newObject.CreateObjectUtils.java
License:Open Source License
private static String insertFOXML(NewDigitalObject node, Document mods, Document dc, String sysno, Map<String, String> processedPages) throws CreateObjectException { if (processedPages == null) processedPages = new HashMap<String, String>(); return insertFOXML(node, mods, dc, Constants.MAX_NUMBER_OF_INGEST_ATTEMPTS, sysno, processedPages); }
From source file:forplay.rebind.AutoClientBundleGenerator.java
License:Apache License
/** * Filter file set, preferring *.mp3 files where alternatives exist. *//*from w ww.j av a 2 s . c o m*/ private HashSet<File> preferMp3(Set<File> files) { HashMap<String, File> map = new HashMap<String, File>(); for (File file : files) { String path = stripExtension(file.getPath()); if (file.getName().endsWith(".mp3") || !map.containsKey(path)) { map.put(path, file); } } return new HashSet<File>(map.values()); }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public FieldBinding addSyntheticFieldForInnerclass(LocalVariableBinding actualOuterLocalVariable) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(); FieldBinding synthField = (FieldBinding) this.synthetics[SourceTypeBinding.FIELD_EMUL] .get(actualOuterLocalVariable); if (synthField == null) { synthField = new SyntheticFieldBinding( CharOperation.concat(TypeConstants.SYNTHETIC_OUTER_LOCAL_PREFIX, actualOuterLocalVariable.name), actualOuterLocalVariable.type, ClassFileConstants.AccPrivate | ClassFileConstants.AccFinal | ClassFileConstants.AccSynthetic, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.FIELD_EMUL].size()); this.synthetics[SourceTypeBinding.FIELD_EMUL].put(actualOuterLocalVariable, synthField); }//from w ww .j av a2 s. c om // ensure there is not already such a field defined by the user boolean needRecheck; int index = 1; do { needRecheck = false; FieldBinding existingField; if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) { TypeDeclaration typeDecl = this.scope.referenceContext; for (int i = 0, max = typeDecl.fields.length; i < max; i++) { FieldDeclaration fieldDecl = typeDecl.fields[i]; if (fieldDecl.binding == existingField) { synthField.name = CharOperation.concat(TypeConstants.SYNTHETIC_OUTER_LOCAL_PREFIX, actualOuterLocalVariable.name, ("$" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$ needRecheck = true; break; } } } } while (needRecheck); return synthField; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public FieldBinding addSyntheticFieldForInnerclass(ReferenceBinding enclosingType) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(); FieldBinding synthField = (FieldBinding) this.synthetics[SourceTypeBinding.FIELD_EMUL].get(enclosingType); if (synthField == null) { synthField = new SyntheticFieldBinding( CharOperation.concat(TypeConstants.SYNTHETIC_ENCLOSING_INSTANCE_PREFIX, String.valueOf(enclosingType.depth()).toCharArray()), enclosingType,//from w ww . ja va2s. co m ClassFileConstants.AccDefault | ClassFileConstants.AccFinal | ClassFileConstants.AccSynthetic, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.FIELD_EMUL].size()); this.synthetics[SourceTypeBinding.FIELD_EMUL].put(enclosingType, synthField); } // ensure there is not already such a field defined by the user boolean needRecheck; do { needRecheck = false; FieldBinding existingField; if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) { TypeDeclaration typeDecl = this.scope.referenceContext; for (int i = 0, max = typeDecl.fields.length; i < max; i++) { FieldDeclaration fieldDecl = typeDecl.fields[i]; if (fieldDecl.binding == existingField) { if (this.scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_5) { synthField.name = CharOperation.concat(synthField.name, "$".toCharArray()); //$NON-NLS-1$ needRecheck = true; } else { this.scope.problemReporter().duplicateFieldInType(this, fieldDecl); } break; } } } } while (needRecheck); return synthField; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public FieldBinding addSyntheticFieldForClassLiteral(TypeBinding targetType, BlockScope blockScope) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] == null) this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] = new HashMap(); // use a different table than FIELDS, given there might be a collision between emulation of X.this$0 and X.class. FieldBinding synthField = (FieldBinding) this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] .get(targetType);/* w w w .ja v a2s.c o m*/ if (synthField == null) { synthField = new SyntheticFieldBinding( CharOperation.concat(TypeConstants.SYNTHETIC_CLASS, String.valueOf(this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL].size()) .toCharArray()), blockScope.getJavaLangClass(), ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL].size()); this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL].put(targetType, synthField); } // ensure there is not already such a field defined by the user FieldBinding existingField; if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) { TypeDeclaration typeDecl = blockScope.referenceType(); for (int i = 0, max = typeDecl.fields.length; i < max; i++) { FieldDeclaration fieldDecl = typeDecl.fields[i]; if (fieldDecl.binding == existingField) { blockScope.problemReporter().duplicateFieldInType(this, fieldDecl); break; } } } return synthField; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public FieldBinding addSyntheticFieldForAssert(BlockScope blockScope) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(); FieldBinding synthField = (FieldBinding) this.synthetics[SourceTypeBinding.FIELD_EMUL] .get("assertionEmulation"); //$NON-NLS-1$ if (synthField == null) { synthField = new SyntheticFieldBinding(TypeConstants.SYNTHETIC_ASSERT_DISABLED, TypeBinding.BOOLEAN, ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic | ClassFileConstants.AccFinal, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.FIELD_EMUL].size()); this.synthetics[SourceTypeBinding.FIELD_EMUL].put("assertionEmulation", synthField); //$NON-NLS-1$ }/*from ww w . j a v a 2s . c o m*/ // ensure there is not already such a field defined by the user // ensure there is not already such a field defined by the user boolean needRecheck; int index = 0; do { needRecheck = false; FieldBinding existingField; if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) { TypeDeclaration typeDecl = this.scope.referenceContext; for (int i = 0, max = typeDecl.fields.length; i < max; i++) { FieldDeclaration fieldDecl = typeDecl.fields[i]; if (fieldDecl.binding == existingField) { synthField.name = CharOperation.concat(TypeConstants.SYNTHETIC_ASSERT_DISABLED, ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$ needRecheck = true; break; } } } } while (needRecheck); return synthField; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public FieldBinding addSyntheticFieldForEnumValues() { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(); FieldBinding synthField = (FieldBinding) this.synthetics[SourceTypeBinding.FIELD_EMUL] .get("enumConstantValues"); //$NON-NLS-1$ if (synthField == null) { synthField = new SyntheticFieldBinding(TypeConstants.SYNTHETIC_ENUM_VALUES, this.scope.createArrayType(this, 1), ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic | ClassFileConstants.AccFinal, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.FIELD_EMUL].size()); this.synthetics[SourceTypeBinding.FIELD_EMUL].put("enumConstantValues", synthField); //$NON-NLS-1$ }// ww w .ja v a 2 s .co m // ensure there is not already such a field defined by the user // ensure there is not already such a field defined by the user boolean needRecheck; int index = 0; do { needRecheck = false; FieldBinding existingField; if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) { TypeDeclaration typeDecl = this.scope.referenceContext; for (int i = 0, max = typeDecl.fields.length; i < max; i++) { FieldDeclaration fieldDecl = typeDecl.fields[i]; if (fieldDecl.binding == existingField) { synthField.name = CharOperation.concat(TypeConstants.SYNTHETIC_ENUM_VALUES, ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$ needRecheck = true; break; } } } } while (needRecheck); return synthField; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public SyntheticMethodBinding addSyntheticMethod(FieldBinding targetField, boolean isReadAccess) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(); SyntheticMethodBinding accessMethod = null; SyntheticMethodBinding[] accessors = (SyntheticMethodBinding[]) this.synthetics[SourceTypeBinding.METHOD_EMUL] .get(targetField);//from w w w.j ava 2s. co m if (accessors == null) { accessMethod = new SyntheticMethodBinding(targetField, isReadAccess, this); this.synthetics[SourceTypeBinding.METHOD_EMUL].put(targetField, accessors = new SyntheticMethodBinding[2]); accessors[isReadAccess ? 0 : 1] = accessMethod; } else { if ((accessMethod = accessors[isReadAccess ? 0 : 1]) == null) { accessMethod = new SyntheticMethodBinding(targetField, isReadAccess, this); accessors[isReadAccess ? 0 : 1] = accessMethod; } } return accessMethod; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public SyntheticMethodBinding addSyntheticEnumMethod(char[] selector) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(); SyntheticMethodBinding accessMethod = null; SyntheticMethodBinding[] accessors = (SyntheticMethodBinding[]) this.synthetics[SourceTypeBinding.METHOD_EMUL] .get(selector);//from ww w . j ava 2 s.c o m if (accessors == null) { accessMethod = new SyntheticMethodBinding(this, selector); this.synthetics[SourceTypeBinding.METHOD_EMUL].put(selector, accessors = new SyntheticMethodBinding[2]); accessors[0] = accessMethod; } else { if ((accessMethod = accessors[0]) == null) { accessMethod = new SyntheticMethodBinding(this, selector); accessors[0] = accessMethod; } } return accessMethod; }
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public SyntheticFieldBinding addSyntheticFieldForSwitchEnum(char[] fieldName, String key) { if (this.synthetics == null) this.synthetics = new HashMap[MAX_SYNTHETICS]; if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(); SyntheticFieldBinding synthField = (SyntheticFieldBinding) this.synthetics[SourceTypeBinding.FIELD_EMUL] .get(key);// w w w . jav a2s .com if (synthField == null) { synthField = new SyntheticFieldBinding(fieldName, this.scope.createArrayType(TypeBinding.INT, 1), ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.FIELD_EMUL].size()); this.synthetics[SourceTypeBinding.FIELD_EMUL].put(key, synthField); } // ensure there is not already such a field defined by the user boolean needRecheck; int index = 0; do { needRecheck = false; FieldBinding existingField; if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) { TypeDeclaration typeDecl = this.scope.referenceContext; for (int i = 0, max = typeDecl.fields.length; i < max; i++) { FieldDeclaration fieldDecl = typeDecl.fields[i]; if (fieldDecl.binding == existingField) { synthField.name = CharOperation.concat(fieldName, ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$ needRecheck = true; break; } } } } while (needRecheck); return synthField; }