Class MemberController
- java.lang.Object
-
- java.util.Observable
-
- net.ssehub.easy.producer.core.mgmt.Controller
-
- net.ssehub.easy.producer.core.mgmt.MemberController
-
public class MemberController extends Controller
Creates a new MemberController for a PLP.- Author:
- Hundt, El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmemberIDprivate java.util.LinkedHashMap<java.lang.String,PLPInfo>predecessorsprivate java.util.LinkedHashMap<java.lang.String,PLPInfo>successors
-
Constructor Summary
Constructors Constructor Description MemberController(java.lang.String memberID)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPredecessor(java.lang.String predecessorID)Adds a predecessor project to this model.voidaddPredecessor(PLPInfo info)This method adds a predecessor in case, the predecessor name is known.voidaddSuccessor(java.lang.String successorID)Adds a sucessor project to this model.voidaddSuccessor(PLPInfo info)This method adds a successor.voidclear()This method removes all stored information about pre- and successors.booleancontainsPredecessor(java.lang.String projectName)Check for a specified Predecessor.booleancontainsPredecessor(java.util.UUID inputID)Check for a specified Predecessor.booleancontainsSuccessor(java.lang.String inputID)Check for a specified Successor.private java.util.List<java.lang.String>getAllSuccessors()Returns a list of all direct and indirect successor-IDs.java.util.List<java.lang.String>getPossiblePredecessors()Returns only the successors that are valid in terms of not creating a loop of successors and predecessors.java.util.Set<java.lang.String>getPredecessorIDs()Returns the List of all predecessor ids.java.util.Collection<PLPInfo>getPredecessors()Returns the List of all predecessors.intgetPredecessorsCount()Getter returns the size of the Predecessors because getPredecessors returns a Collection and we may need this parameter.java.lang.Iterable<java.lang.String>getSuccessorIDs()Returns the List of all successor ids.java.lang.Iterable<PLPInfo>getSuccessors()Returns a list of all successor projects.intgetSuccessorsCount()Getter returns the size of the Successors because getSuccessors returns Collection and we may need this parameter.booleanhasPredecessors()Check for Predecessors.booleanhasSuccessors()Check for Successors.MemberIteratorpredecessors()Returns an iterator for all predecessorPLPInfos.voidremovePredecessor(java.lang.String predecessorID)Removes a predecessor by given ID.voidremoveSuccessor(java.lang.String successorID)Removes a successor by given ID.private static voidreplacePLPInfo(java.util.LinkedHashMap<java.lang.String,PLPInfo> map, PLPInfo newPLP)Replaces a PLP info stored with same ID.voidreplacePLPInfo(PLPInfo newPLP)Replaces a PLP info stored with same ID in this controller.voidsetPredecessors(java.util.List<PLPInfo> predecessors)This method replaces all stored information of existing predecessors.voidsetSuccessors(java.util.List<PLPInfo> successors)This method replaces all stored information of existing successors.MemberIteratorsuccessors()Returns an iterator for all successorPLPInfos.-
Methods inherited from class net.ssehub.easy.producer.core.mgmt.Controller
changed, changed
-
-
-
-
Method Detail
-
replacePLPInfo
public void replacePLPInfo(PLPInfo newPLP)
Replaces a PLP info stored with same ID in this controller.- Parameters:
newPLP- the replacing PLP
-
replacePLPInfo
private static void replacePLPInfo(java.util.LinkedHashMap<java.lang.String,PLPInfo> map, PLPInfo newPLP)
Replaces a PLP info stored with same ID.- Parameters:
map- the map to be modifiednewPLP- the replacing PLP
-
hasPredecessors
public boolean hasPredecessors()
Check for Predecessors.- Returns:
- returns true if there is at least one predecessor
-
hasSuccessors
public boolean hasSuccessors()
Check for Successors.- Returns:
- returns true if there is at least one successor
-
containsPredecessor
public boolean containsPredecessor(java.util.UUID inputID)
Check for a specified Predecessor.- Parameters:
inputID- the UUID of the product line member in question- Returns:
- returns true if this UUID is already listed as a predecessor
-
containsPredecessor
public boolean containsPredecessor(java.lang.String projectName)
Check for a specified Predecessor.- Parameters:
projectName- the name of the product line member in question- Returns:
- returns true if this name is already listed as a predecessor
-
containsSuccessor
public boolean containsSuccessor(java.lang.String inputID)
Check for a specified Successor.- Parameters:
inputID- the UUID of the product line member in question- Returns:
- returns true if this UUID is already listed as a successor
-
getPredecessors
public java.util.Collection<PLPInfo> getPredecessors()
Returns the List of all predecessors.- Returns:
- the predecessors
-
getPredecessorIDs
public java.util.Set<java.lang.String> getPredecessorIDs()
Returns the List of all predecessor ids.- Returns:
- the predecessor ids
-
getSuccessorIDs
public java.lang.Iterable<java.lang.String> getSuccessorIDs()
Returns the List of all successor ids.- Returns:
- the successor ids
-
getSuccessors
public java.lang.Iterable<PLPInfo> getSuccessors()
Returns a list of all successor projects.- Returns:
- the successors
-
setPredecessors
public void setPredecessors(java.util.List<PLPInfo> predecessors)
This method replaces all stored information of existing predecessors.- Parameters:
predecessors- A list of all predecessors
-
setSuccessors
public void setSuccessors(java.util.List<PLPInfo> successors)
This method replaces all stored information of existing successors.- Parameters:
successors- A list of all successors
-
addPredecessor
public void addPredecessor(java.lang.String predecessorID)
Adds a predecessor project to this model.- Parameters:
predecessorID- the UUID of the new predecessor
-
addPredecessor
public void addPredecessor(PLPInfo info)
This method adds a predecessor in case, the predecessor name is known.- Parameters:
info- the predecessor info
-
addSuccessor
public void addSuccessor(java.lang.String successorID)
Adds a sucessor project to this model.- Parameters:
successorID- the UUID of the new successor
-
addSuccessor
public void addSuccessor(PLPInfo info)
This method adds a successor.- Parameters:
info- the information on the successor.
-
removePredecessor
public void removePredecessor(java.lang.String predecessorID)
Removes a predecessor by given ID.- Parameters:
predecessorID- The ID of the predecessor
-
removeSuccessor
public void removeSuccessor(java.lang.String successorID)
Removes a successor by given ID.- Parameters:
successorID- The ID of the successor
-
clear
public void clear()
This method removes all stored information about pre- and successors.
-
getPossiblePredecessors
public java.util.List<java.lang.String> getPossiblePredecessors()
Returns only the successors that are valid in terms of not creating a loop of successors and predecessors.- Returns:
- a List of all possible Successors
-
getAllSuccessors
private java.util.List<java.lang.String> getAllSuccessors()
Returns a list of all direct and indirect successor-IDs.- Returns:
- A list of UUIDs from successors
- Since:
- 18.10.2011
-
predecessors
public MemberIterator predecessors()
Returns an iterator for all predecessorPLPInfos.- Returns:
- Iterator for all predecessor
PLPInfos. - Since:
- 23.07.2012
-
successors
public MemberIterator successors()
Returns an iterator for all successorPLPInfos.- Returns:
- Iterator for all successor
PLPInfos. - Since:
- 23.07.2012
-
getPredecessorsCount
public int getPredecessorsCount()
Getter returns the size of the Predecessors because getPredecessors returns a Collection and we may need this parameter.- Returns:
- size The size of the Predecessors-List.
-
getSuccessorsCount
public int getSuccessorsCount()
Getter returns the size of the Successors because getSuccessors returns Collection and we may need this parameter.- Returns:
- size The size of the Successors.List.
-
-