|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectch.epfl.craft.maglib.magnet.DefaultMagnetNode
ch.epfl.craft.magmap.magnet.MagMapMagnetNode
This class represents that data used by the MagnetView.
Each node either encapsulates a blog or a topic, so that it is possible to
drop both of them on the MagnetView.
A MagMapMagnetNode instance retrieves data from the internal
userObject that it encapsulates. This means that we have to deal with
multiple kind of data, whoose loading classes were automatically generated by
XML Spy.
Internally the type for a blog is ThingType, the type for a topic is
rType, but in other MagMap classes, we refer to them as
MagMapMagnetNode instances,of a kind
TOPIC, BLOG, NEWS, PERSON
which can be found via getKind().
id.
To do : implements support for news and persons
Finally, we implment TextFilterable interace provided by
the Glazed List library to enable live filtering
MagnetView| Field Summary | |
static int |
BLOG
The |
protected static java.util.HashMap |
blogToColumnMap
Mapping from blog (idInFile) to column number in the similarity matrix |
protected int |
id
The unique identifier for this node |
protected int |
idinFile
The identifier for this node in the XML file |
protected static int |
lastID
The class counter for the identifiers |
static int |
NEWS
The |
static int |
PERSON
The |
java.util.HashMap |
similarities
The Similarity matrix under hashmap form (faster): it can already have a computed blog-blog or topic-topic similarity inside. |
protected static float[][] |
similaritiesMatrix
The Similarity matrix |
protected static com.schema.MatrixType |
similarityMatrix
The Similarity matrix |
static int |
TOPIC
The |
protected static java.util.HashMap |
topicToRowMap
Mapping from topic (instance) to row number in the similarity matrix |
| Fields inherited from class ch.epfl.craft.maglib.magnet.DefaultMagnetNode |
force, origin, targetOrigin, userObject |
| Constructor Summary | |
MagMapMagnetNode()
Creates a new MagMapMagnetNode instance. |
|
MagMapMagnetNode(java.lang.Object userObject)
Creates a new MagMapMagnetNode instance with the given data.
|
|
| Method Summary | |
java.lang.String |
getAuthor()
Returns the author of the node data |
java.lang.String |
getDescription()
Returns the description (body of the content) of the node data |
void |
getFilterStrings(java.util.List baseList)
Returns the text attribute on of that node on which a search can be done. |
int |
getID()
Returns the unique identifier for this node. |
int |
getIDinFile()
Returns the identifier of the node in the XML. |
int |
getKind()
Returns the kind of userObject that this MagMapMagnetNode
instance encapsulates.
|
float |
getSimilarityWith(MagnetNode aMagnetNode)
Returns the similarity with aMagnetNode.
|
java.lang.String |
getTitle()
Returns the title (subject of the content) of the node data |
java.lang.String |
getURL()
Returns a URL of the original data of that node. |
static void |
setSimilarityMatrix(com.schema.MatrixType matrix)
Sets the similarity matrix for this class. |
java.lang.String |
toString()
Returns the title (subject of the content) of the node data |
| Methods inherited from class ch.epfl.craft.maglib.magnet.DefaultMagnetNode |
getForceField, getOrigin, getUserObject, setForceField, setOrigin, setTargetOrigin, setUserObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int TOPIC
public static final int BLOG
public static final int NEWS
public static final int PERSON
protected int id
protected int idinFile
protected static int lastID
protected static com.schema.MatrixType similarityMatrix
protected static float[][] similaritiesMatrix
protected static java.util.HashMap topicToRowMap
protected static java.util.HashMap blogToColumnMap
public java.util.HashMap similarities
| Constructor Detail |
public MagMapMagnetNode()
MagMapMagnetNode instance.
public MagMapMagnetNode(java.lang.Object userObject)
MagMapMagnetNode instance with the given data.
For this class, this will either be a blog or a topic.
userObject - the object to be used by this node as internal data| Method Detail |
public static void setSimilarityMatrix(com.schema.MatrixType matrix)
matrix - the MagMap similarity matrixpublic int getID()
getIDinFile() as this one returns the unique
identifier of the nodes. (Incremented by this class)
id of this node.public int getIDinFile()
getID() as this one returns the id
as written in the blogs collection or topic collection
(depending on its kind).
Returns -1 if the id could not be found
id of this node in the XML file.public float getSimilarityWith(MagnetNode aMagnetNode)
aMagnetNode.
We will either look in the similarity matrix under table form, or, if the
similarity has already been computed, in the similarity saved in a hashMap
The similarities, depending on the type of nodes, are found in that way:
getSimilarityWith in interface MagnetNodegetSimilarityWith in class DefaultMagnetNodeaMagnetNode - a aMagnetNode.
MagnetNode instance and aMagnetNode.public java.lang.String getTitle()
public java.lang.String getDescription()
public java.lang.String getAuthor()
public java.lang.String getURL()
public int getKind()
MagMapMagnetNode
instance encapsulates.
This methods will return one of these:
public java.lang.String toString()
toString in class DefaultMagnetNodepublic void getFilterStrings(java.util.List baseList)
baseList - the base list in which we add this node's attributes.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||