Package org.objectweb.speedo.genclass

Examples of org.objectweb.speedo.genclass.GenClassElement


  public Object remove(Object key, boolean withCoherence) {
    //if detached, just remove the key entry from the map, it returns the value
      if(detachedStatus != DetachedLifeCycle.DETACHED_NONE) {
        return map.remove(key);
      } else {
      GenClassElement gcelem = (GenClassElement) map.get(key);
      if (gcelem == null) {
        return null;
      }
      gcelem.setStatus(PIndexedElem.ELEM_DELETED);
      Object value = get(key);
      map.remove(key);
      if (withCoherence) {
        Object el = gcelem.getElement(gcpo.speedoGetPOManager());
        if (el != null) {
          gcpo.fireSpeedoElementRemoved(el);
        }
      }
      return value;
View Full Code Here


    public void clear() {
      if (detachedStatus == DetachedLifeCycle.DETACHED_NONE) {
          Iterator i = elements.iterator();
            POManagerItf pm = null;
          while (i.hasNext()) {
              GenClassElement gcelem = (GenClassElement) i.next();
              gcelem.setStatus(PIndexedElem.ELEM_DELETED);
        if (pm == null) {
          pm = gcpo.speedoGetPOManager();
        }
        Object el = gcelem.getElement(pm);
        if (el != null) {
          gcpo.fireSpeedoElementRemoved(el);
        }
          }
      }
View Full Code Here

    public PIndexedElem createPIndexedElem(GenClassAccessor gca) {
        return new MapElem(gca);
    }

    public void paAdd(PIndexedElem elem, Object conn) throws PExceptionIO {
        GenClassElement gcelem = (GenClassElement) elem;
        // the elem is read from the DS, set it to unmodified.
        gcelem.setStatus(PIndexedElem.ELEM_UNMODIFIED);
        elements.add(gcelem);
        map.put(gcelem.getIndex(), gcelem);
    }
View Full Code Here

    synchronized (this) {
      if (contains(o, index)) {
        return null;
      }
      // Put it in the "elements" list
      GenClassElement element = (GenClassElement) createPIndexedElem();
      element.setElement(o);
            return (elements.add(element) ? element : null);
        }
    }
View Full Code Here

    public boolean add(Object o) {
    if (Debug.ON && getLogger() != null) {
      logger.log(BasicLevel.DEBUG, "add()");
    }
    GenClassElement gce = speedoAdd(o, false);

        //Send the event about the new element adding
    if (gce != null) {
      Object obj = o;
      if (obj instanceof PName) {
        obj = gce.getElement(((PersistentObjectItf) gcpo).speedoGetPOManager());
      }
            if (obj instanceof PersistentObjectItf) {
        gcpo.fireSpeedoElementAdded(obj);
      }
        }
View Full Code Here

        return new PIndexedElemIterator(elements, this,
                ((PersistentObjectItf) gcpo).speedoGetPOManager(), ((Loggable) gcpo).getLogger());
    }

    public boolean remove(Object o) {
        GenClassElement gce = speedoRemove2(o);
    if (Debug.ON && getLogger() != null) {
      logger.log(BasicLevel.DEBUG, "remove: gce=" + gce);
    }
        if (gce != null) {
      Object obj = gce.getElement(((PersistentObjectItf) gcpo).speedoGetPOManager());
            if (obj != null) {
              gcpo.fireSpeedoElementRemoved(obj);
      }
        }
        return gce != null;
View Full Code Here

    public Object[] toArray() {
        ArrayList al = new ArrayList(elements.size());
        Iterator it = elements.iterator();
        while (it.hasNext()) {
            GenClassElement gce = (GenClassElement) it.next();
            if (gce.getElemStatus() != PIndexedElem.ELEM_DELETED) {
                al.add(gce.getElement());
            }
        }
        return al.toArray();
    }
View Full Code Here

    public Object[] toArray(Object[] a) {
        ArrayList al = new ArrayList(elements.size());
        Iterator it = elements.iterator();
        while (it.hasNext()) {
            GenClassElement gce = (GenClassElement) it.next();
            if (gce.getElemStatus() != PIndexedElem.ELEM_DELETED) {
                al.add(gce.getElement());
            }
        }
        return al.toArray(a);
    }
View Full Code Here

      }
      if (Debug.ON && getLogger() != null) {
        logger.log(BasicLevel.DEBUG, "speedoAdd(, " + allowDuplicates + "): adding");
      }
      // Put it in the "elements" list
      GenClassElement element = (GenClassElement) createPIndexedElem();
      element.setElement(o);
            return (elements.add(element) ? element : null);
        }
    }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.genclass.GenClassElement

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.