You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.5 KiB
Plaintext
64 lines
1.5 KiB
Plaintext
TITLE:: FluidLabelSet
|
|
summary:: A set of labels associated with IDs
|
|
categories:: Libraries>FluidCorpusManipulation
|
|
related:: Classes/FluidDataSet, Classes/FluidKMeans
|
|
|
|
DESCRIPTION::
|
|
FluidLabelSet is a container associating identifiers with labels.
|
|
|
|
CLASSMETHODS::
|
|
|
|
METHOD:: new
|
|
Make a new instance of a label set, uniquely identified by its name. Creating an instance with a name already in use will throw an exception. Use link::Classes/FluidLabelSet#*at:: or free the existing instance.
|
|
ARGUMENT:: server
|
|
The link::Classes/Server:: on which to create the label set.
|
|
|
|
|
|
INSTANCEMETHODS::
|
|
|
|
PRIVATE:: init, id
|
|
|
|
METHOD:: addLabel
|
|
Add a label to the label set.
|
|
ARGUMENT:: identifier
|
|
The identifier for this label.
|
|
ARGUMENT:: label
|
|
The label to add.
|
|
ARGUMENT:: action
|
|
A function to run when the operation completes.
|
|
|
|
METHOD:: updateLabel
|
|
Change a label in the label set.
|
|
ARGUMENT:: identifier
|
|
The identifier for this label.
|
|
ARGUMENT:: label
|
|
The label to update.
|
|
|
|
METHOD:: getLabel
|
|
Retrieve the label associated with an identifier. Will report an error if the identifier is not present in the set.
|
|
ARGUMENT:: identifier
|
|
The identifier for the label to be retrieved.
|
|
|
|
METHOD:: deleteLabel
|
|
Delete a label given a certain identifier.
|
|
ARGUMENT:: identifier
|
|
The identifier to be deleted.
|
|
|
|
METHOD:: clear
|
|
Empty the label set.
|
|
|
|
|
|
METHOD:: print
|
|
Post an abbreviated content of the label set in the window by default, but you can supply a custom action instead.
|
|
|
|
EXAMPLES::
|
|
|
|
code::
|
|
~ls = FluidLabelSet.new(s);
|
|
|
|
["one", "two", "three"].collect{|x,i| ~ls.addLabel(i, x);};
|
|
~ls.print;
|
|
|
|
~ls.free;
|
|
::
|