public class Connections
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
private java.util.List<Connection> |
connections |
构造器和说明 |
---|
Connections() |
限定符和类型 | 方法和说明 |
---|---|
void |
addConnection(Connection connection)
Adds given Connection to the collection.
|
Connection |
addConnection(Model.Align sourceAlign,
int sourceIndex,
int targetIndex,
boolean hasInterpolation)
Creates a Connection and adds it to the collection.
|
private boolean |
contains(Connection connection)
Checks if collection contains given connection.
|
private boolean |
containsSourceAsTarget(Connection other)
Checks if collections contains a connection with target Align and index
equal to source Align and index of given connection.
|
private boolean |
containsTarget(Connection other)
Checks if collection contains a connection with target Align and index
equal to target Align and index of given connection.
|
private boolean |
containsTargetAsSource(Connection other)
Checks if collections contains a connection with source Align and index
equal to target Align and index of given connection.
|
Connection |
getConnectionAt(Model.Align align,
int index)
Returns a Connection that have the specified Align and
index values either at source or at target if present.
|
java.util.List<Connection> |
getConnections() |
boolean |
hasConnectionAt(Model.Align align,
int index)
Checks if Connection exists that is either source or target at given
align and given index.
|
boolean |
hasSourceAt(Model.Align align,
int index)
Checks if collection contains a Connection with given source Align and
index.
|
boolean |
isEmpty() |
void |
removeConnection(Model.Align align,
int index)
Removes Connections at given align and given index.
|
int |
size() |
private java.util.List<Connection> connections
public boolean isEmpty()
public int size()
public void addConnection(Connection connection) throws IllegalConnectionException
Takes care of preventing duplicate entries and unwanted combinations.
connection
- to be addedIllegalConnectionException
- if unwanted combination or duplication occurspublic Connection addConnection(Model.Align sourceAlign, int sourceIndex, int targetIndex, boolean hasInterpolation) throws IllegalConnectionException
Takes care of preventing duplicate entries and unwanted combinations.
sourceAlign
- sourceIndex
- targetIndex
- hasInterpolation
- IllegalConnectionException
public void removeConnection(Model.Align align, int index)
align
- side where to remove (LEFT or RIGHT)index
- index where to removepublic Connection getConnectionAt(Model.Align align, int index)
align
- side (LEFT or RIGHT) of source or targetindex
- index of source or targetpublic boolean hasConnectionAt(Model.Align align, int index)
align
- side (LEFT or RIGHT) of source or targetindex
- index of source or targetpublic boolean hasSourceAt(Model.Align align, int index)
align
- which side (LEFT or RIGHT)index
- index of sourcepublic java.util.List<Connection> getConnections()
private boolean contains(Connection connection)
connection
- to be comparedprivate boolean containsTarget(Connection other)
other
- to be comparedprivate boolean containsSourceAsTarget(Connection other)
other
- to be comparedprivate boolean containsTargetAsSource(Connection other)
other
- to be compared