KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.inzyme.jmds;
2
3 /**
4  * The base class for input and output crossbar pins.
5  *
6  * @author Mike Schrag
7  */

8 public abstract class DSAbstractCrossBarPin {
9     private DSCrossBar myCrossBar;
10     private int myPinIndex;
11     private int myPinIndexRelated;
12     private int myPhysicalType;
13
14     /**
15      * Constructs a new DSAbstractCrossBarPin.
16      *
17      * @param _crossBar the parent crossbar
18      * @param _pinIndex the index of this pin
19      * @param _pinIndexRelated the index of the related pin
20      * @param _physicalType the physical type of this pin
21      */

22     DSAbstractCrossBarPin(DSCrossBar _crossBar, int _pinIndex, int _pinIndexRelated, int _physicalType) {
23         myCrossBar = _crossBar;
24         myPinIndex = _pinIndex;
25         myPinIndexRelated = _pinIndexRelated;
26         myPhysicalType = _physicalType;
27     }
28     
29     /**
30      * Returns the physical connector type of this pin (one of DSPhysicalConnectorType.PhysConn_xxx)
31      *
32      * @return the physical connector type of this pin
33      */

34     public int getPhysicalType() {
35         return myPhysicalType;
36     }
37     
38     int getPinIndex() {
39         return myPinIndex;
40     }
41
42     int getPinIndexRelated() {
43         return myPinIndexRelated;
44     }
45     
46     DSCrossBar getCrossBar() {
47         return myCrossBar;
48     }
49
50     /**
51      * Returns the related pin for this pin. A related pin would be, for instance, an
52      * audio pin for its corresponding video pin.
53      *
54      * @return the related pin for this pin
55      */

56     public DSInputCrossBarPin getRelatedPin() {
57         return myCrossBar.getInputPinAt(myPinIndexRelated);
58     }
59
60     /**
61      * Convenience method to retrieve the name of the physical connector type of this pin.
62      *
63      * @return the name of the physical connector type of this pin
64      */

65     public String JavaDoc getPhysicalTypeName() {
66         return DSPhysicalConnectorType.getPhysicalTypeName(myPhysicalType);
67     }
68 }
69
Popular Tags