Package java.util

Examples of java.util.IdentityHashMap$ValueIterator


  /**
   * Returns a new non-threadsafe context map.
   */
  public static Map newContext() {
    return new IdentityHashMap();
  }
View Full Code Here


        }
        else if (source == destination) {
            return;
        }
        else {
            this.localIdentityMap.set(new IdentityHashMap());
            this.doMerge(source, destination);
        }
    }
View Full Code Here

        }
    }
   
    private void cascadeMerge(Object source, Object destination) {
        // We are traversing the source object graph, and we'll have to put in an identity map the source object.
        IdentityHashMap localIdentityMap = (IdentityHashMap) DefaultIdMerger.localIdentityMap.get();
        if (! localIdentityMap.containsKey(source)) {
            localIdentityMap.put(source, new Integer(1));
            this.doCascadeMerge(source, destination);
        }
    }
View Full Code Here

    public DefaultPrevalentSystem() {
        this.merger.setPrevalenceInfo(this.prevalenceInfo);
    }
   
    public Object save(Object newEntity) {
        this.localIdentityMap.set(new IdentityHashMap());
        this.internalSave(newEntity);
        return newEntity;
    }
View Full Code Here

    public Object update(Object entity) {
        Object id = null;
        try {
            id = this.prevalenceInfo.getIdResolutionStrategy().resolveId(entity).get(entity);
            if (id != null) {
                this.localIdentityMap.set(new IdentityHashMap());
                this.internalUpdate(entity, id);
                return entity;
            } else {
                throw new PrevaylerUnsavedObjectException("Cannot update unsaved object!");
            }
View Full Code Here

            Map entityMap = this.lookupMap(newEntity.getClass());
            // Assign id:
            id = this.prevalenceInfo.getIdGenerationStrategy().generateId();
            this.prevalenceInfo.getIdResolutionStrategy().resolveId(newEntity).set(newEntity, id);
            // Add the entity to the thread local identity map, for tracking its traversal (an entity once traversed must not be tarversed again):
            IdentityHashMap localIdentityMap = (IdentityHashMap) DefaultPrevalentSystem.localIdentityMap.get();
            localIdentityMap.put(newEntity, new Integer(1));
            // Add the new entity to the system:
            entityMap.put(id, newEntity);
            // Self cascade persistence (needed for updating pointers to already persisted entities):
            this.doCascadePersistence(newEntity, newEntity);
            // Return the new, updated and saved, entity:
View Full Code Here

        //  Get the identity map by the entity class:
        Map entityMap = this.lookupMap(updatedEntity.getClass());
        // Look for the entity in the map and update it (if found):
        Object currentEntity = entityMap.get(id);
        if ((currentEntity != null) && (currentEntity.getClass().equals(updatedEntity.getClass()))) {
            IdentityHashMap localIdentityMap = (IdentityHashMap) DefaultPrevalentSystem.localIdentityMap.get();
            // If the object has still not been reached:
            if (localIdentityMap.get(currentEntity) == null) {
                // Add the actual entity to the thread local identity map, for tracking its traversal (an entity once traversed must not be tarversed again):
                localIdentityMap.put(currentEntity, new Integer(1));
                // Copy new into actual and do cascade persistence:
                this.doCascadePersistence(updatedEntity, currentEntity);
            }
            // Return the updated (original) entity:
            return currentEntity;
View Full Code Here

   * @generated
   */
  public static ENamedElement getElement(IAdaptable hint) {
    Object type = hint.getAdapter(IElementType.class);
    if (elements == null) {
      elements = new IdentityHashMap();

      elements.put(Container_1000, OntoUML.OntoUMLPackage.eINSTANCE
          .getContainer());

      elements.put(Category_2001, OntoUML.OntoUMLPackage.eINSTANCE
View Full Code Here

  /**
   * Create an IdentitySet with default sizing.
   */
  public IdentitySet() {
    this.map = new IdentityHashMap();
  }
View Full Code Here

   * Create an IdentitySet with the given sizing.
   *
   * @param sizing The sizing of the set to create.
   */
  public IdentitySet(int sizing) {
    this.map = new IdentityHashMap( sizing );
  }
View Full Code Here

TOP

Related Classes of java.util.IdentityHashMap$ValueIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.