KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inzyme > jmds > DSOutputCrossBarPin


1 package com.inzyme.jmds;
2
3 /**
4  * Provides an interface to an output pin of a crossbar.
5  *
6  * @author Mike Schrag
7  */

8 public class DSOutputCrossBarPin extends DSAbstractCrossBarPin {
9     private int myRoutedToIndex;
10
11     /**
12      * Constructs a new DSOutputCrossBarPin.
13      *
14      * @param _crossBar the parent crossbar
15      * @param _pinIndex the index of this pin
16      * @param _pinIndexRelated the index of the related pin
17      * @param _physicalType the physical type of this pin
18      * @param _routedToIndex the index of the input pin that this pin is routed to
19      */

20     public DSOutputCrossBarPin(DSCrossBar _crossBar, int _pinIndex, int _pinIndexRelated, int _physicalType, int _routedToIndex) {
21         super(_crossBar, _pinIndex, _pinIndexRelated, _physicalType);
22         myRoutedToIndex = _routedToIndex;
23     }
24     
25     int getRoutedToIndex() {
26         return myRoutedToIndex;
27     }
28     
29     void setRoutedToIndex(int _routedToIndex) {
30         myRoutedToIndex = _routedToIndex;
31     }
32     
33     /**
34      * Routes this output pin to the specified input pin.
35      *
36      * @param _inputPin the input pin to route to
37      */

38     public void routeTo(DSInputCrossBarPin _inputPin) {
39         getCrossBar().route(this, _inputPin);
40     }
41     
42     /**
43      * Returns the input pin that this output pin is routed to
44      *
45      * @return the input pin that this output pin is routed to (or null if it's not routed)
46      */

47     public DSInputCrossBarPin getRoutedToPin() {
48         return getCrossBar().getInputPinAt(myRoutedToIndex);
49     }
50     
51     public String JavaDoc toString() {
52         return "[DSOutputCrossBarPin: physicalType = " + getPhysicalTypeName() + " (" + getPhysicalType() + "); pinIndex = " + getPinIndex() + "; pinIndexRelated = " + getPinIndexRelated() + "; routedToIndex = " + myRoutedToIndex + "]";
53     }
54 }
55
Popular Tags