From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- .../carbonado/util/QuickConstructorGenerator.html | 314 +++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/util/QuickConstructorGenerator.html (limited to 'apidocs/com/amazon/carbonado/util/QuickConstructorGenerator.html') diff --git a/apidocs/com/amazon/carbonado/util/QuickConstructorGenerator.html b/apidocs/com/amazon/carbonado/util/QuickConstructorGenerator.html new file mode 100644 index 0000000..5abe8a7 --- /dev/null +++ b/apidocs/com/amazon/carbonado/util/QuickConstructorGenerator.html @@ -0,0 +1,314 @@ + + + + + + +QuickConstructorGenerator (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.util
+

Class QuickConstructorGenerator

+
+
+ +
+
    +
  • +
    +
    Deprecated.  +
    use QuickConstructorGenerator
    +
    +
    +
    @Deprecated
    +public class QuickConstructorGenerator
    +extends java.lang.Object
    +
    Generates code to invoke constructors. This is a replacement for Constructor which is easier to use and performs + better. In one tested situation, overall performance was improved by about + 10%. + +

    QuickConstructorGenerator is not general purpose however, as the + parameters to the constructor must be known, and the constructor must be + public. It is intended to be used for constructing instances of + auto-generated classes. The exact parameters may be known at compile time, + but the actual object type is not.

    +
    Author:
    +
    Brian S O'Neill
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      static <F> FgetInstance(java.lang.Class<?> objectType, + java.lang.Class<F> factory) +
      Deprecated. 
      +
      Returns a factory instance for one type of object.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QuickConstructorGenerator

        +
        public QuickConstructorGenerator()
        +
        Deprecated. 
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static <F> F getInstance(java.lang.Class<?> objectType,
        +                java.lang.Class<F> factory)
        +
        Deprecated. 
        +
        Returns a factory instance for one type of object. Each method in the + interface defines a constructor via its parameters. Any checked + exceptions declared thrown by the constructor must also be declared by + the method. The method return types can be the same type as the + constructed object or a supertype. + +

        Here is a contrived example for constructing strings. In practice, + such a string factory is is useless, since the "new" operator can be + invoked directly. + +

        + public interface StringFactory {
        +     String newEmptyString();
        +
        +     String newStringFromChars(char[] chars);
        +
        +     String newStringFromBytes(byte[] bytes, String charsetName)
        +         throws UnsupportedEncodingException;
        + }
        + 
        + + Here's an example of it being used: + +
        + StringFactory sf = QuickConstructorGenerator.getInstance(String.class, StringFactory.class);
        + ...
        + String str = sf.newStringFromChars(new char[] {'h', 'e', 'l', 'l', 'o'});
        + 
        +
        Parameters:
        objectType - type of object to construct
        factory - interface defining which objects can be constructed
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if factory type is not an interface or + if it is malformed
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3