org.mymedialite.io
Class RelationData

java.lang.Object
  extended by org.mymedialite.io.RelationData

public class RelationData
extends java.lang.Object

Class that offers static methods to read (binary) relation over entities into SparseBooleanMatrix objects.


Method Summary
static SparseBooleanMatrix read(java.io.BufferedReader reader, IEntityMapping mapping)
          Read binary relation data from file.
static SparseBooleanMatrix read(java.lang.String filename, IEntityMapping mapping)
          Read binary attribute data from file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static SparseBooleanMatrix read(java.lang.String filename,
                                       IEntityMapping mapping)
                                throws java.io.IOException
Read binary attribute data from file. The expected (sparse) line format is: ENTITY_ID whitespace/comma ENTITY_ID for the relations that hold.

Parameters:
filename - the name of the file to be read from
mapping - the mapping object for the given entity type
Returns:
the relation data
Throws:
java.io.IOException

read

public static SparseBooleanMatrix read(java.io.BufferedReader reader,
                                       IEntityMapping mapping)
                                throws java.io.IOException
Read binary relation data from file. The expected (sparse) line format is: ENTITY_ID whitespace/comma ENTITY_ID for the relations that hold.

Parameters:
reader - a StreamReader to be read from
mapping - the mapping object for the given entity type
Returns:
the relation data
Throws:
java.io.IOException