|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph
Interface representing a social network. Users are the individuals consuming music, artists are the artists producing music, userlinks are the links between users (with some name or class attached to them), artistlinks are the links between users and artists, and similar artists are the links between different artists.
Method Summary | |
---|---|
void |
add(Actor u)
Add a user to the graph. |
void |
add(Graph g)
Add a graph (g) to the graph. |
void |
add(Link link)
Adds a userlink to the graph. |
void |
add(PathSet pathSet)
Add a PathSet to this graph. |
void |
add(Property prop)
Add a property to this graph. |
void |
addChild(Graph g)
Set the given graph to be a child of the current graph. |
void |
anonymize()
Replaces all actor IDs with an anonymous numeric ID. |
void |
close()
Close database connections or write to file. |
void |
commit()
Commit the contents to database or storage. |
Actor[] |
getActor()
Retrieve an array of all actors of all types. |
Actor[] |
getActor(java.lang.String type)
Retrieve an array of all actors of a given type. |
Actor |
getActor(java.lang.String type,
java.lang.String ID)
Retrieve the users that has the given ID. |
int |
getActorCount(java.lang.String mode)
Returns the number of actors of the given type |
java.util.Iterator<Actor> |
getActorIterator(java.lang.String type)
Create a read only iterator over all actors. |
java.lang.String[] |
getActorTypes()
List all types - returns null if no actors exist. |
Graph[] |
getChildren()
Returns the children graphs of this object or null if none exist |
Graph |
getChildren(java.lang.String id)
Returns the children graph with the given id or null if there is not a child with that name. |
Graph[] |
getGraphs(java.util.regex.Pattern pattern)
Creates an array of graph objects. |
java.lang.String |
getID()
Return the ID associated with this Graph |
Link[] |
getLink()
Return all user to user links in this graph in an array. |
Link[] |
getLink(java.lang.String type)
Retrieve an array of all userlinks of the given type from this graph or null if no such links are in this graph. |
Link[] |
getLink(java.lang.String type,
Actor sourceActor,
Actor destActor)
Returns all links of the given type (relation) type going from actor sourceActor to actor destActor or null. |
Link[] |
getLinkByDestination(java.lang.String type,
Actor destActor)
Returns all links (edges, arcs) of type (relation) type that point to the given actor. |
Link[] |
getLinkBySource(java.lang.String type,
Actor sourceActor)
Returns all links (edges, arcs) of type (relation) type that go from the given actor to any destination. |
java.lang.String[] |
getLinkTypes()
Returns all link types currently in this graph or null if no links are present. |
Parameter[] |
getParameters()
Obtain a computer-readable description of the parameters and options this graph supports |
Graph |
getParent()
Returns the parent graph of this object or null if this is a root graph |
PathSet[] |
getPathSet()
Return all PathSets associated with this graph. |
PathSet |
getPathSet(java.lang.String id)
Return the named PathSet. |
Property[] |
getProperty()
Returns an array of all properties associated with this object or null if none exist |
Property |
getProperty(java.lang.String type)
Return a property named by the given string or null if no property by this name exists |
Graph |
getSubGraph(java.util.Properties props,
java.util.Set<Actor> actor)
Creates a new graph from the current graph using the Properties props containing the actors actor and all links that link between actors in actor. |
Graph[] |
getSubGraph(Query q)
Return newly created subgraphs that matches the given query FIXME: Currently not implemented in any graph. |
void |
init(java.util.Properties props)
Set the parameters of this graph from the following property object. |
void |
remove(Actor u)
Identifies the given user and removes it and all links involving it from the graph. |
void |
remove(Link ul)
remove all user links with the same type, user ID, and artist ID from the graph |
void |
setID(java.lang.String id)
Set this graph's ID to this value. |
void |
setSubGraph(Query q)
Same as getSubGraph but the resulting graphs are stored internally NOTE: this interface may be removed. |
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model |
---|
addListener |
Method Detail |
---|
void add(Actor u)
u
- user to be included in the graph.void add(Link link)
link
- description of a named link between two usersvoid remove(Actor u)
u
- user to be removed from the graph.void remove(Link ul)
ul
- link to be removed from the graph.Actor getActor(java.lang.String type, java.lang.String ID)
type
- ID
- ID string identifying an user
Actor[] getActor()
Actor[] getActor(java.lang.String type)
type
- class of actor to return
java.util.Iterator<Actor> getActorIterator(java.lang.String type)
type
- type (mode) of actor to return
java.lang.String[] getActorTypes()
Link[] getLink()
Link[] getLink(java.lang.String type)
type
-
Link[] getLinkBySource(java.lang.String type, Actor sourceActor)
type
- type (relation) of link to returnsourceActor
- starting point of the link
Link[] getLinkByDestination(java.lang.String type, Actor destActor)
type
- type (relation) of link to returndestActor
- actor pointed to by links
Link[] getLink(java.lang.String type, Actor sourceActor, Actor destActor)
type
- type (relation) of the link to returnsourceActor
- starting point of the linkdestActor
- actor pointed to by links
java.lang.String[] getLinkTypes()
Graph[] getSubGraph(Query q)
q
- query object to be executed.
void setSubGraph(Query q)
q
- Query to be executedProperty[] getProperty()
Property getProperty(java.lang.String type)
type
- property's name
void add(Property prop)
prop
- property to be added.PathSet[] getPathSet()
PathSet getPathSet(java.lang.String id)
id
- ID of the PathSet to return
void add(PathSet pathSet)
pathSet
- PathSet to be added to this graphvoid setID(java.lang.String id)
id
- graph IDjava.lang.String getID()
void commit()
void add(Graph g)
g
- graph to be addedvoid close()
void anonymize()
Graph getParent()
Graph[] getChildren()
Graph getChildren(java.lang.String id)
id
- ID of the graph to return
void addChild(Graph g)
g
- Child GraphGraph getSubGraph(java.util.Properties props, java.util.Set<Actor> actor) throws java.lang.Exception
props
- Properties for creating a new Graphactor
- subset of graph's actors to make the subgraph from
java.lang.Exception
- if actor is null or properties is nullGraph[] getGraphs(java.util.regex.Pattern pattern)
pattern
- Regular expression for identifying graphs
Parameter[] getParameters()
void init(java.util.Properties props)
props
- properties to be setint getActorCount(java.lang.String mode)
mode
- type of actor to query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |