|
|||||||||
| 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.Clique
public class Clique
Class for describing a completely connected subgraph. No link information is kept - only the actors are stored. Unlike more general graphs, this graph class can only be a leaf graph and must have a parent graph. The graph is populated by checking against the parent to see if clique-conditions still holds
| Field Summary |
|---|
| Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
|---|
listener |
| Constructor Summary | |
|---|---|
Clique()
Creates a new instance of Clique |
|
| Method Summary | |
|---|---|
void |
add(Actor u)
Adds an actor to the clique if The parent is defined The parent contains the actor The actor is pointed to by all previous actors The actor points to every existing actor in the clique |
void |
add(Graph g)
Add a graph (g) to the graph. |
void |
add(Link link)
Intentionally a null operation - links are added implicitly by add(Actor) |
void |
add(PathSet pathSet)
Intentionally a null operation - paths do no make much sense on a clique |
void |
add(Property prop)
Add a property to this graph. |
void |
addChild(Graph g)
Leaf graph only, so intentionally null |
void |
anonymize()
FIXME: anonymizer not implemented |
protected boolean |
checkLinks(Actor u)
Determines if the actor to be added links to all elements of the clique |
void |
close()
Close database connections or write to file. |
void |
commit()
Commit the contents to database or storage. |
int |
compareTo(java.lang.Object o)
CompareTo operator for Cliques. |
Clique |
duplicate()
Create a duplicate Clique that is equal to the original |
boolean |
equals(java.lang.Object obj)
Equals iff compareTo=0. |
Clique |
expand(Actor u)
Identical to add(Actor u) except that this Clique is unchanged and a new Clique is returned. |
java.util.HashSet<Clique> |
expand(Graph g)
Given this clique (and the graph) - generate all cliques of one bigger size that have this clique as a subclique where the new actor is greater (by compareTo) than any other actor in the clique. |
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 mode)
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()
Leaf graph only, so intentionally null |
Graph |
getChildren(java.lang.String id)
Leaf graph only, so intentionally null |
java.util.Iterator<Graph> |
getChildrenIterator()
|
Graph[] |
getGraphs(java.util.regex.Pattern pattern)
Deprecated. |
java.lang.String |
getID()
Return the ID associated with this Graph |
java.util.List<Actor> |
getIntersection()
Returns an unsorted array of actors that every member of the clique points to. |
java.util.List<Link> |
getLink()
Null operation - links are implicit, not explicitly defined. |
java.util.List<Link> |
getLink(java.lang.String type)
Null operation - links are implicit, not explicitly defined. |
java.util.List<Link> |
getLink(java.lang.String type,
Actor sourceActor,
Actor destActor)
Null operation - links are implicit, not explicitly defined. |
java.util.Iterator<Link> |
getLinkByDesinationIterator(java.lang.String type,
Actor destActor)
|
java.util.List<Link> |
getLinkByDestination(java.lang.String type,
Actor destActor)
Null operation - links are implicit, not explicitly defined. |
java.util.List<Link> |
getLinkBySource(java.lang.String type,
Actor sourceActor)
Null operation - links are implicit, not explicitly defined. |
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()
Null operation - links are implicit, not explicitly defined. |
Actor |
getMaxActor()
Return the largest (by compareTo) actor in this clique. |
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()
Intentionally a null operation - paths do no make much sense on a clique |
PathSet |
getPathSet(java.lang.String id)
Intentionally a null operation - paths do no make much sense on a clique |
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()
|
Graph |
getSubGraph(Properties props,
java.util.Set<Actor> actor)
Intentionally null since this graph can have no children. |
void |
init(Properties props)
Set the parameters of this graph from the following property object. |
protected void |
internalExpand(Actor u)
Adds a new actor to the graph if the new graph will still be a clique |
Graph |
prototype()
|
void |
remove(Actor u)
Remove actor intentionally a null operation |
void |
remove(Link ul)
Intentionally a null operation - links are added implicitly by add(Actor) so removing them makes no sense (unless an actor is removed) |
void |
removeProperty(java.lang.String ID)
|
void |
setActorType(java.lang.String type)
Establishes the type (mode) of actor this clique pulls from |
void |
setID(java.lang.String id)
Set this graph's ID to this value. |
void |
setRelation(java.lang.String rel)
Establishes which link type (relation) determines whether an acotr (node) belongs in a clique or not |
void |
setSubGraph(Query q)
Intentionally null since this class can not have child graphs |
protected void |
start(Actor u)
Initializes a clique - add an actor and initialize the intersection HashSet to all destinations this object links to (by keeping a set of all actors that are linked to by all actors in a clique, determining whether a new actor belongs is O(n) with the size of the clique for actors in the set and constant for those not.) |
Graph |
transform()
Takes the existing Clique graph and transforms it into the graph type returned by the GrahphFactory object. |
| Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
|---|
addListener, fireChange |
| Methods inherited from class java.lang.Object |
|---|
clone, 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 Clique()
| Method Detail |
|---|
public void add(Actor u)
add in interface Graphu - actor to be (potentially) added to this clique.public void add(Link link)
add in interface Graphlink - ignoredpublic void remove(Actor u)
remove in interface Graphu - user to be removed from the graph.public void remove(Link ul)
remove in interface Graphul - ignored
public Actor getActor(java.lang.String type,
java.lang.String ID)
Graph
getActor in interface GraphID - ID string identifying an user
public java.util.List<Actor> getActor()
Graph
getActor in interface Graphpublic java.util.List<Actor> getActor(java.lang.String type)
Graph
getActor in interface Graphtype - class of actor to return
public java.util.List<java.lang.String> getActorTypes()
Graph
getActorTypes in interface Graphpublic java.util.List<Link> getLink()
getLink in interface Graphpublic java.util.List<Link> getLink(java.lang.String type)
getLink in interface Graph
public java.util.List<Link> getLinkBySource(java.lang.String type,
Actor sourceActor)
getLinkBySource in interface Graphtype - type (relation) of link to returnsourceActor - starting point of the link
public java.util.List<Link> getLinkByDestination(java.lang.String type,
Actor destActor)
getLinkByDestination in interface Graphtype - type (relation) of link to returndestActor - actor pointed to by links
public java.util.List<Link> getLink(java.lang.String type,
Actor sourceActor,
Actor destActor)
getLink in interface Graphtype - type (relation) of the link to returnsourceActor - starting point of the linkdestActor - actor pointed to by links
public java.util.List<java.lang.String> getLinkTypes()
getLinkTypes in interface Graphpublic void setSubGraph(Query q)
q - ignoredpublic java.util.List<Property> getProperty()
Graph
getProperty in interface Graphpublic Property getProperty(java.lang.String type)
Graph
getProperty in interface Graphtype - property's name
public void add(Property prop)
Graph
add in interface Graphprop - property to be added.public java.util.List<PathSet> getPathSet()
getPathSet in interface Graphpublic PathSet getPathSet(java.lang.String id)
getPathSet in interface Graphid - ignored
public void add(PathSet pathSet)
add in interface GraphpathSet - ignoredpublic void setRelation(java.lang.String rel)
rel - name of the link type (relation)public void setID(java.lang.String id)
Graph
setID in interface Graphid - graph IDpublic java.lang.String getID()
Graph
getID in interface Graphprotected void start(Actor u)
u - actor that initializes this clique - technically not a clique until
the second actor is added.protected void internalExpand(Actor u)
u - actor to be addedprotected boolean checkLinks(Actor u)
u - actor to be checked
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - Clique to be compared againstpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - object to check for equalitypublic java.util.HashSet<Clique> expand(Graph g)
g - parent graph
public Clique duplicate()
public java.util.Iterator<Actor> getActorIterator(java.lang.String type)
Graph
getActorIterator in interface Graphtype - type (mode) of actor to return
public void setActorType(java.lang.String type)
type - name of the type (mode) of actor.public void commit()
Graph
commit in interface Graphpublic void add(Graph g)
Graph
add in interface Graphg - graph to be addedpublic void close()
Graph
close in interface Graphpublic void anonymize()
anonymize in interface Graphpublic Graph getParent()
Graph
getParent in interface Graphpublic java.util.List<Graph> getChildren()
getChildren in interface Graphpublic Graph getChildren(java.lang.String id)
getChildren in interface Graphid - ID of the graph to return
public void addChild(Graph g)
addChild in interface Graphg - Child Graphpublic Clique expand(Actor u)
u - Actor to be added
public java.util.List<Actor> getIntersection()
public Actor getMaxActor()
public Graph getSubGraph(Properties props,
java.util.Set<Actor> actor)
public Graph[] getGraphs(java.util.regex.Pattern pattern)
pattern -
public Properties getParameter()
Graph
getParameter in interface Graphpublic void init(Properties props)
Graph
init in interface Graphprops - properties to be setpublic int getActorCount(java.lang.String mode)
Graph
getActorCount in interface Graphmode - type of actor to query
public Graph transform()
public java.util.Iterator<Actor> getActorIterator()
getActorIterator in interface Graphpublic java.util.Iterator<Link> getLinkIterator()
getLinkIterator in interface Graphpublic 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 Graphpublic java.util.Iterator<Property> getPropertyIterator()
getPropertyIterator in interface Graphpublic java.util.Iterator<PathSet> getPathSetIterator()
getPathSetIterator in interface Graphpublic java.util.Iterator<Graph> getChildrenIterator()
getChildrenIterator in interface Graphpublic Parameter getParameter(java.lang.String name)
getParameter in interface Graphpublic Graph prototype()
prototype in interface Graphpublic 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 | ||||||||