Examples of Share


Examples of org.libreplan.business.planner.entities.Share

        if (each.getAllowedExtraEffort() == null && !each.isOverAssignableWithoutLimit()) {
            return noSpaceAvailable();
        }
        EffortDuration effort = each.getAllowedExtraEffort() != null ? each
                .getAllowedExtraEffort() : maxExtraEffort;
        return new Share(-effort.getSeconds());
    }
View Full Code Here

Examples of org.libreplan.business.planner.entities.Share

                .getAllowedExtraEffort() : maxExtraEffort;
        return new Share(-effort.getSeconds());
    }

    private Share noSpaceAvailable() {
        return new Share(Integer.MAX_VALUE);
    }
View Full Code Here

Examples of org.libreplan.business.planner.entities.Share

    }

    private List<Share> createUnlimitedShares(Capacity[] capacities) {
        List<Share> result = new ArrayList<Share>();
        for (Capacity each : capacities) {
            result.add(each.isOverAssignableWithoutLimit() ? new Share(0)
                    : noSpaceAvailable());
        }
        return result;
    }
View Full Code Here

Examples of org.objectweb.speedo.pobjects.detach.Share

   * Test the detach method on a Big Decimal : bug fixed to update a big decimal object when detaching it.
   */
  public void testDetachModifyAttachCollection() {
    logger.log(BasicLevel.DEBUG, "*****************testDetachModifyAttachCollection************");
    //1st create 2 shares and prices
    Share share1 = new Share(1);
    Share share2 = new Share(2);
   
    SharePrice sp11 = new SharePrice(11, 2004, 11, new BigDecimal(11000));
    SharePrice sp12 = new SharePrice(12, 2004, 11, new BigDecimal(12000));
    SharePrice sp13 = new SharePrice(13, 2004, 11, new BigDecimal(13000));
   
    share1.addPrice(sp11);
    share1.addPrice(sp12);
    share1.addPrice(sp13);
   
    SharePrice sp21 = new SharePrice(21, 2005, 11, new BigDecimal(21000));
    SharePrice sp22 = new SharePrice(22, 2005, 11, new BigDecimal(22000));
    SharePrice sp23 = new SharePrice(23, 2005, 11, new BigDecimal(23000));
   
    share1.addPrice(sp21);
    share1.addPrice(sp22);
    share1.addPrice(sp23);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    pm.makePersistent(share1);
    pm.makePersistent(share2);
    pm.currentTransaction().commit();
   
    Share copyOfShare = (Share) pm.detachCopy((Object)share1);
    logger.log(BasicLevel.DEBUG, "share detached");
    SharePrice price = copyOfShare.getPrice(12,2004,11);
    if (price != null) {
        price.setPrice(new BigDecimal(99000));
    }
    SharePrice newSp = new SharePrice(31, 2006, 11, new BigDecimal(31000));
    copyOfShare.addPrice(newSp);
    try {
      logger.log(BasicLevel.DEBUG, "share price updated");
      pm.currentTransaction().begin();
      Share attachedShare = (Share) pm.makePersistent((Object)copyOfShare);
      pm.currentTransaction().commit();
      assertEquals(copyOfShare.getId(), attachedShare.getId());
      assertEquals("Collection of prices for the detached share and its attached copy is not the same.", copyOfShare.getPrices().size(), attachedShare.getPrices().size());
      logger.log(BasicLevel.DEBUG, "share attached");
    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      pm.close();
View Full Code Here

Examples of pvss.Share

            ObjectInputStream ois = new ObjectInputStream(bais);
            ECKSObject ecksobj;
            ecksobj = (ECKSObject) ois.readObject();
            if(ecksobj.getECfilename() != null)
              erasurec.put(ecksobj.getECfilename(), ecksobj.getECbytes());
            Share sk_share = ecksobj.getSKshare();
            if(sk_share != null){
              keyshares[sk_share.getIndex()] = sk_share;
              if(i < 1)
                this.response = ecksobj.getECbytes();
              i++;
            }
          }
View Full Code Here

Examples of pvss.Share

            ObjectInputStream ois = new ObjectInputStream(bais);
            ECKSObject ecksobj;
            ecksobj = (ECKSObject) ois.readObject();
            if(ecksobj.getECfilename() != null)
              erasurec.put(ecksobj.getECfilename(), ecksobj.getECbytes());
            Share sk_share = ecksobj.getSKshare();
            if(sk_share != null){
              keyshares[sk_share.getIndex()] = sk_share;
              if(i < 1)
                this.response = ecksobj.getECbytes();
              i++;
            }
          }
View Full Code Here

Examples of pvss.Share

      throws IOException, ClassNotFoundException, InvalidVSSScheme {
    PVSSEngine engine = PVSSEngine.getInstance(reg.info);
    Share[] orderedShares = new Share[N];
    //share ordering for recombination to process or else it fails
    for (int i = 0; i < shares.length; i++) {
      Share s = shares[i];
      if (s == null) {
        continue;
      }
      orderedShares[s.getIndex()] = s;
    }

    return engine.generalCombineShares(orderedShares);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.