|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnz.ac.waikato.mcennis.rat.graph.model.ModelShell
nz.ac.waikato.mcennis.rat.graph.MemGraph
public class MemGraph
A graph object that is held entirely in memory
nz.ac.waikato.mcennis.arm.graph.Graph
,
Serialized FormField Summary |
---|
Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
---|
listener |
Constructor Summary | |
---|---|
MemGraph()
Creates a new instance of MemGraph |
Method Summary | |
---|---|
void |
add(Actor u)
Add a user to the graph. |
void |
add(Graph uid)
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. |
int |
compareTo(java.lang.Object o)
|
java.lang.String |
escapeXML(java.lang.String base)
Encode the string so that it is XML safe |
java.util.List<Actor> |
getActor()
Retrieve an array of all actors of all types. |
java.util.List<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 type)
Returns the number of actors of the given type |
java.util.Iterator<Actor> |
getActorIterator()
|
java.util.Iterator<Actor> |
getActorIterator(java.lang.String type)
Create a read only iterator over all actors. |
java.util.List<java.lang.String> |
getActorTypes()
List all types - returns null if no actors exist. |
java.util.List<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. |
java.util.Iterator<Graph> |
getChildrenIterator()
|
java.lang.String |
getID()
Return the ID associated with this Graph |
java.util.List<Link> |
getLink()
Return all user to user links in this graph in an array. |
java.util.List<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. |
java.util.List<Link> |
getLink(java.lang.String type,
Actor source,
Actor dest)
Returns all links of the given type (relation) type going from actor sourceActor to actor destActor or null. |
java.util.Iterator<Link> |
getLinkByDesinationIterator(java.lang.String type,
Actor destActor)
|
protected java.util.LinkedList<Link> |
getLinkByDestination(Actor a)
|
java.util.List<Link> |
getLinkByDestination(java.lang.String type,
Actor dest)
Returns all links (edges, arcs) of type (relation) type that point to the given actor. |
protected java.util.LinkedList<Link> |
getLinkBySource(Actor a)
|
java.util.List<Link> |
getLinkBySource(java.lang.String type,
Actor source)
Returns all links (edges, arcs) of type (relation) type that go from the given actor to any destination. |
java.util.Iterator<Link> |
getLinkBySourceIterator(java.lang.String type,
Actor sourceActor)
|
java.util.Iterator<Link> |
getLinkIterator()
|
java.util.Iterator<Link> |
getLinkIterator(java.lang.String type)
|
java.util.Iterator<Link> |
getLinkIterator(java.lang.String type,
Actor sourceActor,
Actor destActor)
|
java.util.List<java.lang.String> |
getLinkTypes()
Returns all link types currently in this graph or null if no links are present. |
Properties |
getParameter()
Obtain a computer-readable description of the parameters and options this graph supports |
Parameter |
getParameter(java.lang.String name)
|
Graph |
getParent()
Returns the parent graph of this object or null if this is a root graph |
java.util.List<PathSet> |
getPathSet()
Return all PathSets associated with this graph. |
PathSet |
getPathSet(java.lang.String id)
Return the named PathSet. |
java.util.Iterator<PathSet> |
getPathSetIterator()
|
java.util.List<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 |
java.util.Iterator<Property> |
getPropertyIterator()
|
void |
init(Properties map)
Set the parameters of this graph from the following property object. |
void |
outputXML(java.io.Writer output,
boolean isInnerGraph)
Serializes MemGraphs to an XML file |
Graph |
prototype()
|
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 |
removeProperty(java.lang.String id)
|
void |
setID(java.lang.String id)
Set this graph's ID to this value. |
void |
setWriter(java.io.Writer w)
Set the output stream to serialize into when closed |
Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
---|
addListener, fireChange |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model |
---|
addListener |
Constructor Detail |
---|
public MemGraph()
Method Detail |
---|
public void add(Link link)
Graph
add
in interface Graph
link
- description of a named link between two userspublic void add(Actor u)
Graph
add
in interface Graph
u
- user to be included in the graph.public Actor getActor(java.lang.String type, java.lang.String ID)
Graph
getActor
in interface Graph
ID
- ID string identifying an user
public java.util.List<Actor> getActor(java.lang.String type)
Graph
getActor
in interface Graph
type
- class of actor to return
public void outputXML(java.io.Writer output, boolean isInnerGraph) throws java.io.IOException
output
- output stream to serialize intoisInnerGraph
- is this the root graph (requiring headers) or an inner
graph.
java.io.IOException
public java.util.List<Actor> getActor()
Graph
getActor
in interface Graph
public java.util.List<Link> getLinkBySource(java.lang.String type, Actor source)
Graph
getLinkBySource
in interface Graph
type
- type (relation) of link to returnsource
- starting point of the link
public java.util.List<Link> getLinkByDestination(java.lang.String type, Actor dest)
Graph
getLinkByDestination
in interface Graph
type
- type (relation) of link to returndest
- actor pointed to by links
public java.util.List<Link> getLink(java.lang.String type, Actor source, Actor dest)
Graph
getLink
in interface Graph
type
- type (relation) of the link to returnsource
- starting point of the linkdest
- actor pointed to by links
public java.util.List<Link> getLink()
Graph
getLink
in interface Graph
public java.util.List<Link> getLink(java.lang.String type)
Graph
getLink
in interface Graph
public void remove(Actor u)
Graph
remove
in interface Graph
u
- user to be removed from the graph.public void remove(Link ul)
Graph
remove
in interface Graph
ul
- link to be removed from the graph.public java.util.List<Property> getProperty()
Graph
getProperty
in interface Graph
public Property getProperty(java.lang.String type)
Graph
getProperty
in interface Graph
type
- property's name
public void add(Property prop)
Graph
add
in interface Graph
prop
- property to be added.public java.util.List<PathSet> getPathSet()
Graph
getPathSet
in interface Graph
public void add(PathSet pathSet)
Graph
add
in interface Graph
pathSet
- PathSet to be added to this graphpublic PathSet getPathSet(java.lang.String id)
Graph
getPathSet
in interface Graph
id
- ID of the PathSet to return
public java.util.List<java.lang.String> getLinkTypes()
Graph
getLinkTypes
in interface Graph
public java.util.List<java.lang.String> getActorTypes()
Graph
getActorTypes
in interface Graph
public void setID(java.lang.String id)
Graph
setID
in interface Graph
id
- graph IDpublic java.lang.String getID()
Graph
getID
in interface Graph
public java.util.Iterator<Actor> getActorIterator(java.lang.String type)
Graph
getActorIterator
in interface Graph
type
- type (mode) of actor to return
public void add(Graph uid)
Graph
add
in interface Graph
uid
- graph to be addedpublic void commit()
Graph
commit
in interface Graph
public void close()
Graph
close
in interface Graph
public void setWriter(java.io.Writer w)
w
- target output streampublic java.lang.String escapeXML(java.lang.String base)
base
- string to encode
public void anonymize()
Graph
anonymize
in interface Graph
public Graph getParent()
Graph
getParent
in interface Graph
public java.util.List<Graph> getChildren()
Graph
getChildren
in interface Graph
public Graph getChildren(java.lang.String id)
Graph
getChildren
in interface Graph
id
- ID of the graph to return
public void addChild(Graph g)
Graph
addChild
in interface Graph
g
- Child Graphprotected java.util.LinkedList<Link> getLinkBySource(Actor a)
protected java.util.LinkedList<Link> getLinkByDestination(Actor a)
public int getActorCount(java.lang.String type)
Graph
getActorCount
in interface Graph
type
- type of actor to query
public Properties getParameter()
Graph
getParameter
in interface Graph
public Parameter getParameter(java.lang.String name)
getParameter
in interface Graph
public void init(Properties map)
Graph
init
in interface Graph
map
- properties to be setpublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public Graph prototype()
prototype
in interface Graph
public java.util.Iterator<Actor> getActorIterator()
getActorIterator
in interface Graph
public java.util.Iterator<Link> getLinkIterator()
getLinkIterator
in interface Graph
public java.util.Iterator<Link> getLinkIterator(java.lang.String type)
getLinkIterator
in interface Graph
public java.util.Iterator<Link> getLinkBySourceIterator(java.lang.String type, Actor sourceActor)
getLinkBySourceIterator
in interface Graph
public java.util.Iterator<Link> getLinkByDesinationIterator(java.lang.String type, Actor destActor)
getLinkByDesinationIterator
in interface Graph
public java.util.Iterator<Link> getLinkIterator(java.lang.String type, Actor sourceActor, Actor destActor)
getLinkIterator
in interface Graph
public java.util.Iterator<Property> getPropertyIterator()
getPropertyIterator
in interface Graph
public java.util.Iterator<PathSet> getPathSetIterator()
getPathSetIterator
in interface Graph
public java.util.Iterator<Graph> getChildrenIterator()
getChildrenIterator
in interface Graph
public void removeProperty(java.lang.String id)
removeProperty
in interface Graph
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |