|
||||||||||
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. |
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)
FIXME: actor iterator not implemented yet. |
java.lang.String[] |
getActorTypes()
List all types - returns null if no actors exist. |
Graph[] |
getChildren()
Leaf graph only, so intentionally null |
Graph |
getChildren(java.lang.String id)
Leaf graph only, so intentionally null |
Graph[] |
getGraphs(java.util.regex.Pattern pattern)
Creates an array of graph objects. |
java.lang.String |
getID()
Return the ID associated with this Graph |
Actor[] |
getIntersection()
Returns an unsorted array of actors that every member of the clique points to. |
Link[] |
getLink()
Null operation - links are implicit, not explicitly defined. |
Link[] |
getLink(java.lang.String type)
Null operation - links are implicit, not explicitly defined. |
Link[] |
getLink(java.lang.String type,
Actor sourceActor,
Actor destActor)
Null operation - links are implicit, not explicitly defined. |
Link[] |
getLinkByDestination(java.lang.String type,
Actor destActor)
Null operation - links are implicit, not explicitly defined. |
Link[] |
getLinkBySource(java.lang.String type,
Actor sourceActor)
Null operation - links are implicit, not explicitly defined. |
java.lang.String[] |
getLinkTypes()
Null operation - links are implicit, not explicitly defined. |
Actor |
getMaxActor()
Return the largest (by compareTo) actor in this clique. |
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()
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 |
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)
Intentionally null since this graph can have no children. |
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. |
protected void |
internalExpand(Actor u)
Adds a new actor to the graph if the new graph will still be a clique |
void |
remove(Actor u)
FIXME: remove actor currently does nothing |
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 |
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.) |
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 Graph
u
- actor to be (potentially) added to this clique.public void add(Link link)
add
in interface Graph
link
- ignoredpublic void remove(Actor u)
remove
in interface Graph
u
- user to be removed from the graph.public void remove(Link ul)
remove
in interface Graph
ul
- ignoredpublic Actor getActor(java.lang.String type, java.lang.String ID)
Graph
getActor
in interface Graph
ID
- ID string identifying an user
public Actor[] getActor()
Graph
getActor
in interface Graph
public Actor[] getActor(java.lang.String type)
Graph
getActor
in interface Graph
type
- class of actor to return
public java.lang.String[] getActorTypes()
Graph
getActorTypes
in interface Graph
public Link[] getLink()
getLink
in interface Graph
public Link[] getLink(java.lang.String type)
getLink
in interface Graph
public Link[] getLinkBySource(java.lang.String type, Actor sourceActor)
getLinkBySource
in interface Graph
type
- type (relation) of link to returnsourceActor
- starting point of the link
public Link[] getLinkByDestination(java.lang.String type, Actor destActor)
getLinkByDestination
in interface Graph
type
- type (relation) of link to returndestActor
- actor pointed to by links
public Link[] getLink(java.lang.String type, Actor sourceActor, Actor destActor)
getLink
in interface Graph
type
- type (relation) of the link to returnsourceActor
- starting point of the linkdestActor
- actor pointed to by links
public java.lang.String[] getLinkTypes()
getLinkTypes
in interface Graph
public Graph[] getSubGraph(Query q)
Graph
getSubGraph
in interface Graph
q
- query object to be executed.
public void setSubGraph(Query q)
setSubGraph
in interface Graph
q
- ignoredpublic 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 PathSet[] getPathSet()
getPathSet
in interface Graph
public PathSet getPathSet(java.lang.String id)
getPathSet
in interface Graph
id
- ignored
public void add(PathSet pathSet)
add
in interface Graph
pathSet
- 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 Graph
id
- graph IDpublic java.lang.String getID()
Graph
getID
in interface Graph
protected 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.Comparable
o
- Clique to be compared againstpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- 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)
getActorIterator
in interface Graph
type
- 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 Graph
public void add(Graph g)
Graph
add
in interface Graph
g
- graph to be addedpublic void close()
Graph
close
in interface Graph
public void anonymize()
anonymize
in interface Graph
public Graph getParent()
Graph
getParent
in interface Graph
public Graph[] getChildren()
getChildren
in interface Graph
public Graph getChildren(java.lang.String id)
getChildren
in interface Graph
id
- ID of the graph to return
public void addChild(Graph g)
addChild
in interface Graph
g
- Child Graphpublic Clique expand(Actor u)
u
- Actor to be added
public Actor[] getIntersection()
public Actor getMaxActor()
public Graph getSubGraph(java.util.Properties props, java.util.Set<Actor> actor)
getSubGraph
in interface Graph
props
- Properties for creating a new Graphactor
- subset of graph's actors to make the subgraph from
public Graph[] getGraphs(java.util.regex.Pattern pattern)
Graph
getGraphs
in interface Graph
pattern
- Regular expression for identifying graphs
public Parameter[] getParameters()
Graph
getParameters
in interface Graph
public void init(java.util.Properties props)
Graph
init
in interface Graph
props
- properties to be setpublic int getActorCount(java.lang.String mode)
Graph
getActorCount
in interface Graph
mode
- type of actor to query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |