|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.io.PartitionDecorationReader
public class PartitionDecorationReader
Reads decorations for vertices in a specified partition from a
Reader
.
Constructor Summary | |
---|---|
PartitionDecorationReader()
|
Method Summary | |
---|---|
static int |
loadCounts(Graph bg,
Reader count_reader,
Predicate partition,
Object count_key,
UserDataContainer.CopyAction copyact)
Decorates vertices in the specified partition with typed count data. |
static void |
loadCounts(Graph bg,
Reader count_reader,
Predicate partition,
Object count_key,
UserDataContainer.CopyAction copyact,
int num_types)
|
static void |
loadStrings(Graph bg,
Reader name_reader,
Predicate partition,
Object string_key)
Decorates vertices in the specified partition with strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PartitionDecorationReader()
Method Detail |
---|
public static void loadStrings(Graph bg, Reader name_reader, Predicate partition, 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, Reader count_reader, Predicate partition, 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 decorations
public static void loadCounts(Graph bg, Reader count_reader, Predicate partition, Object count_key, UserDataContainer.CopyAction copyact, int num_types)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |