Examples of clone()


Examples of org.broadleafcommerce.core.order.domain.DiscreteOrderItem.clone()

                orderItem.removeAllAdjustments();
                orderItem.removeAllCandidateItemOffers();
                DiscreteOrderItem discreteOrderItem = (DiscreteOrderItem) orderItem;
                if (discreteOrderItem.getSku().getActiveStartDate() != null) {
                    if (discreteOrderItem.getSku().isActive(discreteOrderItem.getProduct(), orderItem.getCategory())) {
                        OrderItem newItem = addOrderItemToOrder(customerCart, discreteOrderItem.clone(), false);
                        mergeCartResponse.getAddedItems().add(newItem);
                        oldNewItemMap.put(orderItem, newItem);
                    } else {
                        mergeCartResponse.getRemovedItems().add(orderItem);
                    }
View Full Code Here

Examples of org.bukkit.Location.clone()

                                if (!materials.isEmpty()) {
                                    for (dMaterial material : materials) {
                                        if (material.matchesMaterialData(getBlock()
                                                .getLocation().clone().add(x,y,z).getBlock().getType().getNewData(getBlock()
                                                        .getLocation().clone().add(x,y,z).getBlock().getData()))) {
                                            if (l.clone().add(0,1,0).getBlock().getType() == Material.AIR
                                                    && l.clone().add(0,2,0).getBlock().getType() == Material.AIR
                                                    && l.getBlock().getType() != Material.AIR)
                                                found.add(new dLocation(getBlock().getLocation().clone().add(x + 0.5, y, z + 0.5 )));
                                        }
                                    }
View Full Code Here

Examples of org.bukkit.inventory.ItemStack.clone()

      } else if (slot == 103) {
        playerInv.setHelmet(loadout.get(slot).clone());
      } else {
        ItemStack item = loadout.get(slot);
        if (item != null) {
          playerInv.addItem(item.clone());
        }
      }
    }
    if (this.getWarzoneConfig().getBoolean(WarzoneConfig.BLOCKHEADS)) {
      playerInv.setHelmet(team.getKind().getHat());
View Full Code Here

Examples of org.bukkit.util.BlockVector.clone()

        ArrayList<Block> lakeBlocks = new ArrayList<>();
        for (int i = -1; i < 4; i++) {
            Vector center = new BlockVector(rx, ry - i, rz);
            for (int x = -radius; x <= radius; x++) {
                for (int z = -radius; z <= radius; z++) {
                    Vector position = center.clone().add(new Vector(x, 0, z));
                    if (center.distance(position) <= radius + 0.5 - i) {
                        lakeBlocks.add(world.getBlockAt(position.toLocation(world)));
                    }
                }
            }
View Full Code Here

Examples of org.bukkit.util.Vector.clone()

            double v = speed.asDouble();
            Vector relative = destination.clone().subtract(originLocation).toVector();
            double testAng = Velocity.launchAngle(originLocation, destination.toVector(), v, relative.getY(), g);
            double hangTime = Velocity.hangtime(testAng, v, relative.getY(), g);
            Vector to = destination.clone().add(lead.clone().multiply(hangTime)).toVector();
            relative = to.clone().subtract(originLocation.toVector());
            Double dist = Math.sqrt(relative.getX() * relative.getX() + relative.getZ() * relative.getZ());
            if (dist == 0) dist = 0.1d;
            testAng = Velocity.launchAngle(originLocation, to, v, relative.getY(), g);
            relative.setY(Math.tan(testAng) * dist);
            relative = relative.normalize();
View Full Code Here

Examples of org.candle.decompiler.intermediate.graph.edge.IntermediateEdge.clone()

        //add an edge to the intermediate graph.
        if(intermediateGraph.containsEdge(predIntermediate, nodeIntermediate)) {
          continue;
        }
         
        intermediateGraph.addEdge(predIntermediate, nodeIntermediate, (IntermediateEdge)insEdge.clone());
      }
     
      for(InstructionHandle successor : successors) {
        //find it's AbstractIntermediate.
        AbstractIntermediate successorIntermediate = nodeMapping.get(successor);
View Full Code Here

Examples of org.cipango.sip.NameAddr.clone()

{
  @Test
  public void testAddress() throws Exception
  {
    Address orig = new NameAddr("\"Hello World\" <sip:foo@bar.com;transport=tcp>;tag=12345");
    Address readOnly = new ReadOnlyAddress((Address) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("tag"); fail();} catch (IllegalStateException e) {}
    try { readOnly.setDisplayName(""); fail();} catch (IllegalStateException e) {}
View Full Code Here

Examples of org.cipango.sip.ParameterableImpl.clone()

  @Test
  public void testParameterable() throws Exception
  {
    Parameterable orig = new ParameterableImpl("\"Hello World\" <sip:foo@bar.com;transport=tcp>;tag=12345");
    Parameterable readOnly = new ReadOnlyParameterable((Parameterable) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("tag"); fail();} catch (IllegalStateException e) {}
    try { readOnly.setValue(""); fail();} catch (IllegalStateException e) {}
View Full Code Here

Examples of org.cipango.sip.SipURIImpl.clone()

  @Test
  public void testSipUri() throws Exception
  {
    SipURI orig = new SipURIImpl("sip:foo@bar.com;transport=tcp?to=sip:bob%40biloxi.com");
    SipURI readOnly = new ReadOnlySipURI((SipURI) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("transport"); fail();} catch (IllegalStateException e) {} 
    try { readOnly.setHeader("subject", "toto"); fail();} catch (IllegalStateException e) {}
View Full Code Here

Examples of org.cipango.sip.TelURLImpl.clone()

  @Test
  public void testTelUrl() throws Exception
  {
    TelURL orig = new TelURLImpl("tel:+3398648;user=phone");
    TelURL readOnly = new ReadOnlyTelURL((TelURL) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("user");   fail();} catch (IllegalStateException e) {}
    assertEquals(orig, readOnly);
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.