|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.geometry.ConnectionChain
public final class ConnectionChain
Represents a directed connection chain between two frames connected through the frame tree.
| Nested Class Summary | |
|---|---|
class |
ConnectionChain.ConnectionIterator
An iterator over the connections of a ConnectionChain. |
| Constructor Summary | |
|---|---|
ConnectionChain(Frame source,
Frame target)
Creates a new connection instance from a source frame to a target frame. |
|
| Method Summary | |
|---|---|
Frame |
getRoot()
|
Frame |
getSource()
Returns the frame that was given to the constructor as source, or the root frame if null was given. |
Frame |
getTarget()
Returns the frame that was given to the constructor as target, or the root frame if null was given. |
boolean |
isConnected()
|
ConnectionChain.ConnectionIterator |
iterator()
Returns an iterator over the frame connections from source (as returned by getSource()) to target (as
returned by getTarget()). |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionChain(Frame source,
Frame target)
isConnected() method. If the frames are not connected,
the query methods other than getSource() and getTarget() will throw an exception.
Caution: The caller should make sure that the frame tree is not modified between creating an instance of this class and calling the methods that query the connection.
This methods locks both the frame tree of the source frame and the frame tree of the target frame during the
creation of the connection chain using the lock returned by Frame.getFrameTreeLock(). If the
Frames that are passed in are thread safe (e.g. ObjectFrames), the frame tree traversal is
guaranteed to be thread safe. Otherwise, if the implementation is not thread safe (e.g. LocalFrame),
thread safety will have to be taken care of by the caller.
source - the source of the connection. Can be queried later by getSource().
If null, the top-level parent frame will be used as source.target - the target of the connection. Can be queried later by getTarget().
If null, the top-level parent frame will be used as target.
IllegalArgumentException - if both arguments are null| Method Detail |
|---|
public boolean isConnected()
true if a connection between the frames given in the constructor was found,
false otherwise.public Frame getSource()
null was given.
null.public Frame getTarget()
null was given.
null.public Frame getRoot()
null is
returned.isConnected()public ConnectionChain.ConnectionIterator iterator()
getSource()) to target (as
returned by getTarget()). If the frames are not connected, the iterator will have no elements.
The iterator will be of type ConnectionChain.ConnectionIterator, which provides the method
ConnectionChain.ConnectionIterator.isNextUp(). This method will return true while the iteration is on the
path upwards from source to the root frame, and false if on the path from root to target.
iterator in interface Iterable<IFrameConnection>public int size()
isConnected()), the
number of connection is 0.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||