var Controls = function (controllable_object) { this.ref = controllable_object; }; Controls.prototype.next = function () { this.ref.foo(); } // .. var Carousel = function () { this.controls = new Controls(this); }; // ..
private CertRequest(ASN1Sequence seq) { certReqId = new ASN1Integer(ASN1Integer.getInstance(seq.getObjectAt(0)).getValue()); certTemplate = CertTemplate.getInstance(seq.getObjectAt(1)); if (seq.size() > 2) { controls = Controls.getInstance(seq.getObjectAt(2)); } }
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type) { if (controls == null) { return null; } AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray(); AttributeTypeAndValue found = null; for (int i = 0; i != tAndVs.length; i++) { if (tAndVs[i].getType().equals(type)) { found = tAndVs[i]; break; } } return found; }
private CertRequest(ASN1Sequence seq) { certReqId = new ASN1Integer(ASN1Integer.getInstance(seq.getObjectAt(0)).getValue()); certTemplate = CertTemplate.getInstance(seq.getObjectAt(1)); if (seq.size() > 2) { controls = Controls.getInstance(seq.getObjectAt(2)); } }
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type) { if (controls == null) { return null; } AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray(); AttributeTypeAndValue found = null; for (int i = 0; i != tAndVs.length; i++) { if (tAndVs[i].getType().equals(type)) { found = tAndVs[i]; break; } } return found; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); menu = new Controls(this); menu.getSomeView().setOnClickListener(this); setContentView(menu); }
JPanel p=new JPanel(new FlowLayout()); p.add(new Controls()); content.add(p);
public static Controls getInstance(Object o) { if (o instanceof Controls) { return (Controls)o; } if (o != null) { return new Controls(ASN1Sequence.getInstance(o)); } return null; }
public static Controls getInstance(Object o) { if (o instanceof Controls) { return (Controls)o; } if (o != null) { return new Controls(ASN1Sequence.getInstance(o)); } return null; }
var scene = new Scene(); var controls = new Controls(); scene.AddToUpdate(controls.update); scene.Animate();
function Controls(what) { //what do we need to control this.controlWhat=what; } Controls.prototype.moveLeft = function() { console.log(this.controlWhat.speed, this.controlWhat.walkDistant); return this.controlWhat.speed * this.controlWhat.walkDistant; }; function Player() { this.speed = 1; this.walkDistant = 5; this.controls=new Controls(this); } var firstPlayer = new Player(); console.log(firstPlayer.controls.moveLeft());