Skip to content

Commit

Permalink
Renaming "Node n" to "Node node" for better readibility
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Jun 26, 2016
1 parent da821fc commit e6334c1
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 238 deletions.
10 changes: 5 additions & 5 deletions src/main/doc/resources/org/thegalactic/dgraph/DGraph.iuml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.thegalactic.dgraph {
+SortedSet<Edge> getPredecessorEdges(final Node node)
+SortedSet<Node> getSuccessorNodes(final Node node)
+SortedSet<Node> getPredecessorNodes(final Node node)
+Edge getEdge(final Node from, final Node to)
+Edge getEdge(final Node source, final Node target)
+Node getNode(final Object search)
+Node getNodeByContent(final Object content)
+Node getNodeByIdentifier(int identifier)
Expand All @@ -33,7 +33,7 @@ package org.thegalactic.dgraph {
#DGraph setPredecessors(final TreeMap<Node, TreeSet<Edge>> predecessors)
.. Predicates ..
+boolean containsNode(final Node node)
+boolean containsEdge(final Node from, final Node to)
+boolean containsEdge(final Node source, final Node target)
+boolean containsEdge(final Edge edge)
+boolean isAcyclic()
.. Transformers ..
Expand All @@ -42,12 +42,12 @@ package org.thegalactic.dgraph {
+void save(final String filename)
.. Operations ..
+boolean addNode(final Node node)
+boolean addEdge(final Node from, final Node to, final Object content)
+boolean addEdge(final Node from, final Node to)
+boolean addEdge(final Node source, final Node target, final Object content)
+boolean addEdge(final Node source, final Node target)
+boolean addEdge(final Edge edge)
+boolean removeNode(final Node node)
+boolean removeNodes(final Set<Node> nodes)
+boolean removeEdge(final Node from, final Node to)
+boolean removeEdge(final Node source, final Node target)
+boolean removeEdge(final Edge edge)
+ArrayList<Node> topologicalSort()
+DGraph getSubgraphByNodes(final Set<Node> nodes)
Expand Down
12 changes: 6 additions & 6 deletions src/main/doc/resources/org/thegalactic/dgraph/Edge.iuml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.thegalactic.dgraph {
class Edge {
-Node from
-Node to
-Node source
-Node target
-Object content
.. Constructors ..
+Edge(final Node from, final Node to, final Object content)
+Edge(final Node from, final Node to)
+Edge(final Node source, final Node target, final Object content)
+Edge(final Node source, final Node target)
.. Accessors ..
+Node getFrom()
+Node getTo()
+Node getSource()
+Node getTarget()
+Object getContent()
.. Mutators ..
+Edge setContent(final Object content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package org.thegalactic.lattice {
+ConceptLattice(TreeSet<Concept> set)
+ConceptLattice(Lattice lattice)
.. Modifiers ..
+boolean addNode(Node n)
+boolean addEdge(Node from, Node to)
+boolean addNode(Node node)
+boolean addEdge(Node source, Node target)
+boolean removeAllSetA()
+boolean removeAllSetB()
+Concept getConcept(ComparableSet setA, ComparableSet setB)
Expand All @@ -31,7 +31,7 @@ package org.thegalactic.lattice {
+{static} ConceptLattice diagramLattice(ClosureSystem init)
+ConceptLattice iceberg(float threshold)
+void recursiveDiagramLattice(Concept n, ClosureSystem init)
+Vector<TreeSet<Comparable>> immediateSuccessors(Node n, ClosureSystem init)
+Vector<TreeSet<Comparable>> immediateSuccessors(Node node, ClosureSystem init)
}

Lattice <|-- ConceptLattice
Expand Down
4 changes: 2 additions & 2 deletions src/main/doc/resources/org/thegalactic/lattice/Lattice.iuml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package org.thegalactic.lattice {

+TreeSet<Node> joinIrreducibles()
+TreeSet<Node> meetIrreducibles()
+TreeSet<Comparable> joinIrreducibles(Node n)
+TreeSet<Comparable> meetIrreducibles(Node n)
+TreeSet<Comparable> joinIrreducibles(Node node)
+TreeSet<Comparable> meetIrreducibles(Node node)
+DAGraph joinIrreduciblesSubgraph()
+DAGraph meetIrreduciblesSubgraph()
+DAGraph irreduciblesSubgraph()
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/thegalactic/context/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ public ArrayList<Context> getDivisionContext() {
public TreeSet<Node> getDivisionConvex(Context ctx) {
ConceptLattice factor = ctx.conceptLattice(true);
TreeSet<Node> convex = new TreeSet<Node>();
for (Node n : factor.getNodes()) {
Concept c = (Concept) n;
for (Node node : factor.getNodes()) {
Concept c = (Concept) node;
if (!c.getSetB().containsAll(this.getExtent(c.getSetA()))
&& !c.getSetA().containsAll(this.getIntent(c.getSetB()))) {
convex.add(n);
convex.add(node);
}
}
return convex;
Expand Down Expand Up @@ -1164,8 +1164,8 @@ public ComparableSet inverseClosure(ComparableSet set) {
public ConceptLattice conceptLattice(boolean diagram) {
ConceptLattice csl = this.closedSetLattice(diagram);
// TreeMap<Concept, Concept> nodes = new TreeMap<Concept, Concept>();
for (Node n : csl.getNodes()) {
Concept cl = (Concept) n;
for (Node node : csl.getNodes()) {
Concept cl = (Concept) node;
cl.putSetB(new ComparableSet(this.getExtent(cl.getSetA())));
}
return csl;
Expand All @@ -1188,13 +1188,13 @@ private ArrayList<Couple> reccursiveGenProd(Couple c, LinkedList<ConceptLattice>
} else {
ConceptLattice cl = (ConceptLattice) copy.poll();
ArrayList<Couple> nodes = new ArrayList<Couple>();
for (Node n : cl.getNodes()) {
for (Node node : cl.getNodes()) {
ArrayList<Concept> listCopy = new ArrayList<Concept>();
for (Concept cpt : (ArrayList<Concept>) c.getLeft()) {
listCopy.add(cpt);
}
Couple coupleCopy = new Couple(listCopy, c.getRight());
((ArrayList<Concept>) coupleCopy.getLeft()).add((Concept) n);
((ArrayList<Concept>) coupleCopy.getLeft()).add((Concept) node);
nodes.addAll(reccursiveGenProd(coupleCopy, copy));
}
return nodes;
Expand Down Expand Up @@ -1261,12 +1261,12 @@ public Lattice subDirectDecomposition() {
ArrayList<Couple> nodes = new ArrayList<Couple>();
LinkedList<ConceptLattice> copy = (LinkedList<ConceptLattice>) clParts.clone();
ConceptLattice firstCL = (ConceptLattice) copy.poll();
for (Node n : firstCL.getNodes()) {
Couple c = new Couple(new ArrayList<Concept>(), false);
for (Node node : firstCL.getNodes()) {
Couple couple = new Couple(new ArrayList<Concept>(), false);
ArrayList<Concept> prodCPT = new ArrayList<Concept>();
prodCPT.add((Concept) n);
c.setLeft(prodCPT);
nodes.addAll(reccursiveGenProd(c, copy));
prodCPT.add((Concept) node);
couple.setLeft(prodCPT);
nodes.addAll(reccursiveGenProd(couple, copy));
}
for (Couple c : nodes) {
prod.addNode(new Node(c));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/thegalactic/dgraph/DGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,9 @@ public DAGraph getStronglyConnectedComponent() {
}
// second depth first search according to sort
TreeSet<Node> visited = new TreeSet<Node>();
for (Node n : sort) {
if (!visited.contains(n)) {
last = transposedGraph.depthFirstSearch(n, visited, sort)[1];
for (Node node : sort) {
if (!visited.contains(node)) {
last = transposedGraph.depthFirstSearch(node, visited, sort)[1];
visited.addAll(last);
TreeSet<Node> sCC = new TreeSet<Node>(last);
// a strongly connected component is generated
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/thegalactic/lattice/ArrowRelation.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public ArrowRelation(Lattice lattice) {
* Nodes are join or meet irreductibles of the lattice.
*/
TreeSet<Node> joins = new TreeSet<Node>(lattice.joinIrreducibles());
for (Node n : joins) {
this.addNode(n);
for (Node node : joins) {
this.addNode(node);
}
TreeSet<Node> meets = new TreeSet<Node>(lattice.meetIrreducibles());
for (Node n : meets) {
this.addNode(n);
for (Node node : meets) {
this.addNode(node);
}
Lattice transitiveClosure = new Lattice(lattice);
transitiveClosure.transitiveClosure();
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/thegalactic/lattice/ClosureSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ public DGraph precedenceGraph() {
DGraph prec = new DGraph();
TreeMap<Comparable, Node> nodeCreated = new TreeMap<Comparable, Node>();
for (Comparable x : this.getSet()) {
Node n = new Node(x);
prec.addNode(n);
nodeCreated.put(x, n);
Node node = new Node(x);
prec.addNode(node);
nodeCreated.put(x, node);
}
// edges of the graph are closures containments
for (Comparable source : this.getSet()) {
Expand Down Expand Up @@ -285,8 +285,8 @@ public TreeMap<Object, TreeSet> getReducibleElements() {
// Finaly, checking a remaining attribute equivalent to its predecessors or not may reduce more attributes.
// Check all remaining nodes of graph G
TreeSet<Node> remainingNodes = new TreeSet<Node>();
for (Node n : graph.getNodes()) {
remainingNodes.add(n);
for (Node node : graph.getNodes()) {
remainingNodes.add(node);
}
remainingNodes.removeAll(rubbishBin);
for (Node x : remainingNodes) {
Expand All @@ -299,8 +299,8 @@ public TreeMap<Object, TreeSet> getReducibleElements() {
TreeSet closureSet = this.closure(set);
// Create the closure of predecessors
TreeSet<Comparable> pred = new TreeSet<Comparable>();
for (Node n : predecessors) {
pred.add((Comparable) n.getContent());
for (Node node : predecessors) {
pred.add((Comparable) node.getContent());
}
TreeSet<Comparable> closureP = this.closure(pred);
// Check the equality of two closures
Expand Down
Loading

0 comments on commit e6334c1

Please sign in to comment.