public class Model extends Object
Constructor and Description |
---|
Model()
Creates an empty model.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAction(Action action)
Adds action to the model.
|
boolean |
addKind(Kind kind)
Adds kind to the model.
|
boolean |
addMixin(Mixin mixin)
Adds mixin to the model.
|
void |
clearActions()
Remove all actions from the model.
|
void |
clearKinds()
Remove all kinds from the model.
|
void |
clearMixins()
Remove all mixins from the model.
|
boolean |
containsAction(Action action)
Checks whether model contains a action
|
boolean |
containsAction(String actionIdentifier)
Checks whether model contains a action specified by the identifier
|
boolean |
containsKind(Kind kind)
Checks whether model contains a kind
|
boolean |
containsKind(String kindIdentifier)
Checks whether model contains a kind specified by the identifier
|
boolean |
containsMixin(Mixin mixin)
Checks whether model contains a mixin
|
boolean |
containsMixin(String mixinIdentifier)
Checks whether model contains a mixin specified by the identifier
|
boolean |
equals(Object obj) |
Action |
findAction(String term)
Finds action with given term in model.
|
Action |
findAction(URI identifier)
Finds action with given identifier (schema+term) in model.
|
Kind |
findKind(String term)
Finds kind with given term in model.
|
Kind |
findKind(URI identifier)
Finds kind with given identifier (schema+term) in model.
|
CollectionType |
findKindType(Kind kind)
Determines CollectionType for given kind (for parsing purposes).
|
CollectionType |
findKindType(String location)
Determines CollectionType for kind with given location (for parsing
purposes).
|
Mixin |
findMixin(String term)
Finds mixin with given term in model.
|
Mixin |
findMixin(String term,
String rel)
Finds mixin with given term and relation in model.
|
Mixin |
findMixin(String term,
URI rel)
Finds mixin with given term and relation in model.
|
Mixin |
findMixin(URI identifier)
Finds mixin with given identifier (schema+term) in model.
|
List<Kind> |
findRelatedKinds(String term)
Finds kinds related to kind specified by given term.
|
List<Kind> |
findRelatedKinds(URI identifier)
Finds kinds related to kind specified by given identifier.
|
List<Mixin> |
findRelatedMixins(String term)
Finds mixins related to mixin specified by given term.
|
List<Mixin> |
findRelatedMixins(URI identifier)
Finds mixins related to mixin specified by given identifier.
|
Action |
getAction(String actionIdentifier)
Retrieves a action from the model.
|
Set<Action> |
getActions()
Returns all actions from the model in a form of set.
|
Kind |
getKind(String kindIdentifier)
Retrieves a kind from the model.
|
Set<Kind> |
getKinds()
Returns all kinds from the model in a form of set.
|
Mixin |
getMixin(String mixinIdentifier)
Retrieves a mixin from the model.
|
Set<Mixin> |
getMixins()
Returns all mixins from the model in a form of set.
|
int |
hashCode() |
boolean |
removeAction(Action action)
Removes action from model.
|
boolean |
removeKind(Kind kind)
Removes kind from model.
|
boolean |
removeMixin(Mixin mixin)
Removes mixin from model.
|
String |
toString()
Resturns string representation of the model
|
public boolean containsKind(Kind kind)
kind
- kind looked up in the modelpublic boolean containsKind(String kindIdentifier)
kindIdentifier
- identifier for the kind looked up in the modelpublic boolean addKind(Kind kind)
kind
- kind to be added to the modelpublic Kind getKind(String kindIdentifier)
kindIdentifier
- identifier of the kind to be retrievedpublic boolean removeKind(Kind kind)
kind
- kind to be removed from the modelpublic void clearKinds()
public Set<Kind> getKinds()
public boolean containsMixin(Mixin mixin)
mixin
- mixin looked up in the modelpublic boolean containsMixin(String mixinIdentifier)
mixinIdentifier
- identifier for the mixin looked up in the modelpublic boolean addMixin(Mixin mixin)
mixin
- mixin to be added to the modelpublic Mixin getMixin(String mixinIdentifier)
mixinIdentifier
- identifier of the mixin to be retrievedpublic boolean removeMixin(Mixin mixin)
mixin
- mixin to be removed from the modelpublic void clearMixins()
public Set<Mixin> getMixins()
public boolean containsAction(Action action)
action
- action looked up in the modelpublic boolean containsAction(String actionIdentifier)
actionIdentifier
- identifier for the action looked up in the modelpublic boolean addAction(Action action)
action
- action to be added to the modelpublic Action getAction(String actionIdentifier)
actionIdentifier
- identifier of the action to be retrievedpublic boolean removeAction(Action action)
action
- action to be removed from the modelpublic void clearActions()
public Set<Action> getActions()
public Kind findKind(URI identifier)
identifier
- public Kind findKind(String term) throws AmbiguousIdentifierException
term
- AmbiguousIdentifierException
- if model contains more than one kind
with given termpublic List<Kind> findRelatedKinds(URI identifier)
identifier
- public List<Kind> findRelatedKinds(String term) throws AmbiguousIdentifierException
term
- AmbiguousIdentifierException
- if model contains more than one kind
with given termpublic CollectionType findKindType(Kind kind)
kind
- public CollectionType findKindType(String location)
location
- public Mixin findMixin(URI identifier)
identifier
- public Mixin findMixin(String term) throws AmbiguousIdentifierException
term
- AmbiguousIdentifierException
- if model contains more than one
mixin with given termpublic Mixin findMixin(String term, String rel) throws AmbiguousIdentifierException
term
- rel
- term of related mixinAmbiguousIdentifierException
- if model contains more than one
mixin with given termpublic Mixin findMixin(String term, URI rel) throws AmbiguousIdentifierException
term
- rel
- identifier of related mixin (scheme+term)AmbiguousIdentifierException
- if model contains more than one
mixin with given termpublic List<Mixin> findRelatedMixins(URI identifier)
identifier
- public List<Mixin> findRelatedMixins(String term) throws AmbiguousIdentifierException
term
- AmbiguousIdentifierException
- if model contains more than one
mixin with given termpublic Action findAction(String term) throws AmbiguousIdentifierException
term
- AmbiguousIdentifierException
- if model contains more than one
action with given termpublic Action findAction(URI identifier)
identifier
- public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- object to compare model withObject.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2016. All Rights Reserved.