24 lines
618 B
Java
24 lines
618 B
Java
package com.cleverthis.interview;
|
|
|
|
import com.cleverthis.interview.padlock.PadlockImpl;
|
|
|
|
/**
|
|
* The concrete implementation of PadlockAdapter that communicates with the padlock directly through a Java
|
|
* class
|
|
*/
|
|
public class PadlockJavaAdapter extends PadlockImpl implements PadlockAdapter {
|
|
/**
|
|
* Create a padlock instance.
|
|
*
|
|
* @param numpadSize The number of buttons on the numpad of this lock.
|
|
*/
|
|
public PadlockJavaAdapter(int numpadSize) {
|
|
super(numpadSize);
|
|
|
|
for(int i = 0; i < this.getNumpadSize(); i++) {
|
|
this.writeInputBuffer(i, i);
|
|
}
|
|
}
|
|
|
|
}
|