bass.visualisation.graph
Class DTOToLists

java.lang.Object
  extended by bass.visualisation.graph.DTOToLists

public class DTOToLists
extends java.lang.Object

This class builds lists of edges and nodes for all inputdata from the db. It converts the DTO objects into specific node and edgelists filled in arrays

Version:
0.2
Author:
Patrick Mai

Field Summary
(package private)  BassEdgeList[] allEdges
           
(package private)  BassNodeList[] allNodes
           
 
Constructor Summary
DTOToLists()
           
 
Method Summary
 java.util.LinkedList<DTO_BandnameWithFList> getDTO(java.lang.String bandId, int minFriends, int depth, Gui theGui)
           
 BassEdgeList[] getEdgeList()
           
 BassNodeList[] getNodeList()
           
 boolean writeLists(java.lang.String bandId, int depth, int minFriends, Gui theGui)
          converts the dto's of the linked list in nodes and edges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allNodes

BassNodeList[] allNodes

allEdges

BassEdgeList[] allEdges
Constructor Detail

DTOToLists

public DTOToLists()
Method Detail

writeLists

public boolean writeLists(java.lang.String bandId,
                          int depth,
                          int minFriends,
                          Gui theGui)
converts the dto's of the linked list in nodes and edges. We have chosen arrays for storing each list cause this male it easier to use each list. i.E. We don't have to iterate through each edgeoutlist of a node to get it's friends in the layout and in the view class.

Parameters:
bandId - the user selected targetband from the gui
depth - one level or two
minFriends - the minimum amount of friends a band needs to get involved into the calculation
Returns:
true if everything went right, false if an error has occured

getDTO

public java.util.LinkedList<DTO_BandnameWithFList> getDTO(java.lang.String bandId,
                                                          int minFriends,
                                                          int depth,
                                                          Gui theGui)
Returns:
The LinkedList with the targetband incl. it's friends, names, id's etc...

getNodeList

public BassNodeList[] getNodeList()
Returns:
the complete BassNodeListArray with all BassNodes(Bands).

getEdgeList

public BassEdgeList[] getEdgeList()
Returns:
the complete BassEdgeListArray with all BassEdges(edges between bands).