MCPcopy
hub / github.com/careercup/ctci / append

Method append

java/Chapter 18/Question18_13/Rectangle.java:75–88  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

73 * underlying matrix of this Rectangle object is /not/ modified.
74 */
75 public Rectangle append(String s) {
76 if (s.length() == length) {
77 char temp[][] = new char[height + 1][length];
78 for (int i = 0; i < height; i++) {
79 for (int j = 0; j < length; j++) {
80 temp[i][j] = matrix[i][j];
81 }
82 }
83 s.getChars(0, length, temp[height], 0);
84
85 return new Rectangle(length, height + 1, temp);
86 }
87 return null;
88 }
89
90 /* Print the rectangle out, row by row. */
91 public void print() {

Callers 15

pushMethod · 0.80
pushMethod · 0.80
popMethod · 0.80
__str__Method · 0.80
pushMethod · 0.80
pushMethod · 0.80
dequeue_anyMethod · 0.80
moveDiskMethod · 0.80
pushMethod · 0.80
Question2_6.pyFile · 0.80
isPalindrome_iterFunction · 0.80
__str__Method · 0.80

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected