Advertisement
Guest User

JAVA API DESIGN

a guest
Mar 2nd, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
J 1.08 KB | None | 0 0
  1.  
  2. /**
  3.   Java API design does not need to be thorough in implementation.
  4.   Pseudocode or abstract class is enough for complex components.
  5.   The goal is to show:
  6.     - Each use case in the spec is accounted for
  7.     - It's clear how to create the different use case via documentation
  8.     - How the answer is stored
  9.  */
  10. public class GCCardPatterns {
  11.    
  12.     // Initial placement of the cards, also the correct answer
  13.     List<Integer> placement
  14.     // Array containing images of each card
  15.     List<QMComponent> images
  16.     // Boolean to display arrows under the row; default false
  17.     boolean displayArrows = false
  18.  
  19.     /**
  20.      * Main constructor
  21.      * @param placement: Array of integers detailing placement of cards
  22.      * @param images: Array of QMComponents to be displayed
  23.      * ... detailed explanation of each param and how its used in API
  24.      */
  25.     GCCardPatterns(
  26.         List<Integer> placement,
  27.         List<QMComponent> images
  28.     ) {
  29.         // assign everything
  30.     }
  31.  
  32.     // Use this for the case you want arrows under rows
  33.     GCCardPatterns displayArrows() {
  34.         this.displayArrows = true;
  35.         return this;
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement