public class Collection extends Object
Constructor and Description |
---|
Collection()
Creates an empty collection instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAction(ActionInstance action)
Adds action instance to the collection.
|
boolean |
addLink(Link link)
Adds link instance to the collection.
|
boolean |
addResource(Resource resource)
Adds resource instance to the collection.
|
void |
clearActions()
Removes all actions from the collection.
|
void |
clearLinks()
Removes all links from the collection.
|
void |
clearResources()
Removes all resources from the collection.
|
boolean |
containsAction(ActionInstance action)
Checks whether collection contains the action.
|
boolean |
containsAction(String actionIdentifier)
Checks whether collection contains the action specified by its
identifier.
|
boolean |
containsLink(Link link)
Checks whether collection contains the link.
|
boolean |
containsLink(String linkIdentifier)
Checks whether collection contains the link specified by its identifier.
|
boolean |
containsResource(Resource resource)
Checks whether collection contains the resource.
|
boolean |
containsResource(String resourceIdentifier)
Checks whether collection contains the resource specified by its
identifier.
|
boolean |
equals(Object obj) |
ActionInstance |
getAction(String actionIdentifier)
Retrieves the action specified by its identifier from the collection.
|
Set<ActionInstance> |
getActions()
Returns all actions in the collection in form of a set.
|
Link |
getLink(String linkIdentifier)
Retrieves the link specified by its identifier from the collection.
|
Set<Link> |
getLinks()
Returns all links in the collection in form of a set.
|
Model |
getModel()
Returns collection's model.
|
Resource |
getResource(String resourceIdentifier)
Retrieves the resource specified by its identifier from the collection.
|
Set<Resource> |
getResources()
Returns all resources in the collection in form of a set.
|
int |
hashCode() |
void |
merge(Collection collection)
Merges collection's content to the current collection.
|
boolean |
removeAction(ActionInstance action)
Removes action from the collection.
|
boolean |
removeLink(Link link)
Removes link from the collection.
|
boolean |
removeResource(Resource resource)
Removes resource from the collection.
|
void |
setModel(Model model)
Sets model for the whole collection (all the resources, links and actions
in the collection)
|
String |
toString()
Resturns string representation of the collection
|
public boolean containsResource(Resource resource)
resource
- resource looked up in the collectionpublic boolean containsResource(String resourceIdentifier)
resourceIdentifier
- identifier of the resource looked up in the
collectionpublic boolean addResource(Resource resource)
resource
- resource to be added to the collectionpublic Resource getResource(String resourceIdentifier)
resourceIdentifier
- identifier of the retrieved resourcepublic boolean removeResource(Resource resource)
resource
- resource instance to remove from the collectionpublic void clearResources()
public Set<Resource> getResources()
public boolean containsLink(Link link)
link
- link looked up in the collectionpublic boolean containsLink(String linkIdentifier)
linkIdentifier
- identifier of the link looked up in the collectionpublic boolean addLink(Link link)
link
- link to be added to the collectionpublic Link getLink(String linkIdentifier)
linkIdentifier
- identifier of the retrieved linkpublic boolean removeLink(Link link)
link
- link instance to remove from the collectionpublic void clearLinks()
public Set<Link> getLinks()
public boolean containsAction(ActionInstance action)
action
- action looked up in the collectionpublic boolean containsAction(String actionIdentifier)
actionIdentifier
- identifier of the action looked up in the
collectionpublic boolean addAction(ActionInstance action)
action
- action to be added to the collectionpublic ActionInstance getAction(String actionIdentifier)
actionIdentifier
- identifier of the retrieved actionpublic boolean removeAction(ActionInstance action)
action
- action instance to remove from the collectionpublic void clearActions()
public Set<ActionInstance> getActions()
public void merge(Collection collection)
collection
- collection which content should be mergedpublic void setModel(Model model)
model
- model to be set for this collectionpublic Model getModel()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- object to compare collection withObject.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2016. All Rights Reserved.