public class PartitionDecorationReader
extends java.lang.Object
Reader
.Constructor and Description |
---|
PartitionDecorationReader() |
Modifier and Type | Method and Description |
---|---|
static int |
loadCounts(Graph bg,
java.io.Reader count_reader,
org.apache.commons.collections.Predicate partition,
java.lang.Object count_key,
UserDataContainer.CopyAction copyact)
Decorates vertices in the specified partition with typed count data.
|
static void |
loadCounts(Graph bg,
java.io.Reader count_reader,
org.apache.commons.collections.Predicate partition,
java.lang.Object count_key,
UserDataContainer.CopyAction copyact,
int num_types) |
static void |
loadStrings(Graph bg,
java.io.Reader name_reader,
org.apache.commons.collections.Predicate partition,
java.lang.Object string_key)
Decorates vertices in the specified partition with strings.
|
public static void loadStrings(Graph bg, java.io.Reader name_reader, org.apache.commons.collections.Predicate partition, java.lang.Object string_key)
vid_1 label_1 vid_2 label_2 ...
The strings must be unique within this partition; duplicate strings will
cause a UniqueLabelException
to be thrown.
The end of the file may be artificially set by putting the string end_of_file
on a line by itself.
bg
- the bipartite graph whose vertices are to be decoratedname_reader
- the reader containing the decoration informationpartition
- the vertex partition whose decorations are specified by this
filestring_key
- the user data key for the decorations createdpublic static int loadCounts(Graph bg, java.io.Reader count_reader, org.apache.commons.collections.Predicate partition, java.lang.Object count_key, UserDataContainer.CopyAction copyact)
vid_1 type_1 count_1 vid_2 type_2 count_2 ...
where count_i
(an integer value) represents
the number of elements of
type type_i
possessed by the vertex with ID
vid_i
(as defined by BipartiteGraphReader.load()
)
for the i
th line in the file.
For example, the vertices might represent authors, the type might represent a topic, and the count might represent the number of papers that the specified author had written on that topic.
If normalize
is true
, then the
count data will be scaled so that the counts for
each vertex will sum to 1. (In this case, each vertex must have
a positive total count value.)
The end of the file may be artificially set by putting the string
end_of_file
on a line by itself.
bg
- the bipartite graph whose vertices are to be decoratedcount_reader
- the reader containing the decoration datapartition
- the partition whose decorations are specified by this filecount_key
- the user key for the decorationscopyact
- the copy action for the decorationspublic static void loadCounts(Graph bg, java.io.Reader count_reader, org.apache.commons.collections.Predicate partition, java.lang.Object count_key, UserDataContainer.CopyAction copyact, int num_types)