Package de.swa.gc
Class GraphCode
java.lang.Object
de.swa.gc.GraphCode
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ExplainableGraphCode
,SemanticGraphCode
public class GraphCode
extends java.lang.Object
implements java.io.Serializable
Implementation of a Graph Code as a 2D representation of MMIR features
- Author:
- stefan_wagenpfeil
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description GraphCode()
-
Method Summary
Modifier and Type Method Description void
addGraphCode(GraphCode gc)
adds a Graph Code to a collectionjava.util.Vector<GraphCode>
getCollectionElements()
returns the elements of a Graph Code collectionjava.util.Vector<java.lang.String>
getDictionary()
the Graph Code Dictionary contains a list of feature vocabulary termsint
getEdgeValueForTerms(java.lang.String term1, java.lang.String term2)
returns the matrix value for two feature vocabulary termsint[][]
getRelationships()
int
getValue(int x, int y)
returns the matrix value on position x and yboolean
isCollection()
returns, if the Graph Code is part of a collection or a single Graph Codevoid
setDictionary(java.util.Vector<java.lang.String> d)
sets the dictionary of the Graph Code, i.e. the list of feature vocabulary termsvoid
setValue(int x, int y, int v)
sets the matrix value of position x and yvoid
setValueForTerms(java.lang.String term1, java.lang.String term2, int val)
sets the matrix value for two feature vocabulary termsjava.lang.String
toString()
returns a JSon representation of this Graph Cocde
-
Constructor Details
-
GraphCode
public GraphCode()
-
-
Method Details
-
getDictionary
public java.util.Vector<java.lang.String> getDictionary()the Graph Code Dictionary contains a list of feature vocabulary terms -
getRelationships
public int[][] getRelationships() -
addGraphCode
adds a Graph Code to a collection -
getCollectionElements
returns the elements of a Graph Code collection -
setDictionary
public void setDictionary(java.util.Vector<java.lang.String> d)sets the dictionary of the Graph Code, i.e. the list of feature vocabulary terms -
isCollection
public boolean isCollection()returns, if the Graph Code is part of a collection or a single Graph Code -
getValue
public int getValue(int x, int y)returns the matrix value on position x and y -
setValue
public void setValue(int x, int y, int v)sets the matrix value of position x and y -
getEdgeValueForTerms
public int getEdgeValueForTerms(java.lang.String term1, java.lang.String term2)returns the matrix value for two feature vocabulary terms -
setValueForTerms
public void setValueForTerms(java.lang.String term1, java.lang.String term2, int val)sets the matrix value for two feature vocabulary terms -
toString
public java.lang.String toString()returns a JSon representation of this Graph Cocde- Overrides:
toString
in classjava.lang.Object
-