Examples of clone()


Examples of java.awt.print.PageFormat.clone()

   * @return the given pageformat.
   */
  public PageFormat getPageFormat(final int pos)
  {
    final PageFormat fmt = (PageFormat) pageFormatList.get(pos);
    return (PageFormat) fmt.clone();
  }

  /**
   * Describes the internal position of the given page within the logical page. The logical page does not include any
   * page margins, the printable area for a page starts at (0,0).
View Full Code Here

Examples of java.security.MessageDigest.clone()

        try
          {
            md1 = MessageDigest.getInstance(mdName, Registry.GNU_SECURITY);

            md1.update(abc); // start with abc
            md2 = (MessageDigest) md1.clone(); // now clone it

            ba1 = md1.digest(in); // now finish both with in
            ba2 = md2.digest(in);

            harness.check(Arrays.equals(ba1, ba2), "testCloneability(" + mdName
View Full Code Here

Examples of java.security.Signature.clone()

   * @tests java.security.Signature#clone()
   */
  public void test_clone() throws Exception {
           Signature s = Signature.getInstance("DSA");
           try {
             s.clone();
             fail("A Signature may not be cloneable");
           } catch (CloneNotSupportedException e) {
             // Expected - a Signature may not be cloneable
           }
  }
View Full Code Here

Examples of java.security.cert.PKIXCertPathChecker.clone()

            ListIterator<PKIXCertPathChecker> li =
                                clonedState.forwardCheckers.listIterator();
            while (li.hasNext()) {
                PKIXCertPathChecker checker = li.next();
                if (checker instanceof Cloneable) {
                    li.set((PKIXCertPathChecker)checker.clone());
                }
            }

            /*
             * Shallow copy traversed names. There is no need to
View Full Code Here

Examples of java.sql.Timestamp.clone()

        {
            Timestamp result = null;
            if(fieldValue != null)
            {
                Timestamp source = (Timestamp) fieldValue;
                result = (Timestamp) source.clone();
            }
            return result;
        }
    }
View Full Code Here

Examples of java.text.DateFormat.clone()

        if ( df == null ) {
            df = this.map.get( identifier );
            if ( df == null ) {
                throw new RuntimeException( "Unable to find DateFormat for id '" + identifier + "'" );
            }
            this.localMap.get().put( identifier, ( DateFormat ) df.clone() );
        }
       
        try {
            return df.parse( date );
        } catch ( ParseException e ) {
View Full Code Here

Examples of java.text.DecimalFormatSymbols.clone()

  }

  @Benchmark void clonedDecimalFormatSymbols(int reps) {
    DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.US);
    for (int i = 0; i < reps; ++i) {
      dfs.clone();
    }
  }

  @Benchmark void newNumberFormat(int reps) {
    for (int i = 0; i < reps; ++i) {
View Full Code Here

Examples of java.text.MessageFormat.clone()

        assertTrue("Clone not equal", format.equals(clone));
    assertEquals("Wrong answer",
        "{choice}{0}", format.format(new Object[] {}));
        clone.setFormat(0, DateFormat.getInstance());
        assertTrue("Clone shares format data", !format.equals(clone));
        format = (MessageFormat) clone.clone();
        Format[] formats = clone.getFormats();
        ((SimpleDateFormat) formats[0]).applyPattern("adk123");
        assertTrue("Clone shares format data", !format.equals(clone));
    }
View Full Code Here

Examples of java.text.NumberFormat.clone()

        return null;
      else
      {
        NumberFormat nf = nfMap.get(locale);
        if (nf != null)
          return (NumberFormat) nf.clone();
      }
      return null;
    }
  }
View Full Code Here

Examples of java.text.SimpleDateFormat.clone()

  }

  @Benchmark void clonedSimpleDateFormat(int reps) {
    SimpleDateFormat sdf = new SimpleDateFormat();
    for (int i = 0; i < reps; ++i) {
      sdf.clone();
    }
  }
}
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.