Represents a selection of entities in a graph. Selections are immutable.
Users do not normally construct, this object directly. Call thinkmap.graph.Graph.select() to create selections instead.
Constructs a new graph Selection.
the graph the selection belongs to
a BitSet corresponding to the entity id's to select in this graph
Add all of the bits in this selection to the given BitSet.
Tests if all entities in this selection can be removed from the graph associated with this selection. Entities may not be able to be removed because retention policies may have been set that prevent them from being removed.
true if all the entities in this selection can be removed from the graph associated with this selection.
Returns a clone of this selection. The BitSet that underlies this Selection is cloned.
a new selection, a clone of this selection.
Returns a new Selection, that is the complement of this selection and the given selection. The new selection is associated with this graph. The complement contains entities that are in the given selection, but are NOT in this selection.
the selection to complement with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the complement of the two selections.
Returns true if the given entity is contained in this selection
the entity
true if the entity is in this selection
Tell the graph associated with this selection that all the entities in this selection have had their data updated. This may trigger additional events such as display redrawing and index updating.
this selection
Returns a new Selection, that is the set difference of this selection and the given selection. The new selection is associated with this graph. The set difference contains entities that are in this selection, but are NOT in the given selection.
the selection to complement with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the set difference of the two selections.
Return a new Selection (associated with this graph) that is the result of filtering this selection with the given function.
the function to call, if it return true, entites will be included in the returned selection
an optional object to use as the "this" parameter to the given function
a new, filtered selection
Returns the first entity in this selection, or undefined, if this selection is empty. Please note that the order of entities in a selection is undefined.
Calls a function once for each Entity in the selection
the function to call, once for each entity in this selection
an optional object to use as the "this" parameter to the function
this selection
Get the graph that this selection is associated with.
Returns a new Selection, that is the set intersection of this selection and the given selection. The new selection is associated with this graph. The set intersection contains all the entities from this selection and the given selection.
the selection to intersect with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the set intersection of the two selections.
Create an array that consists of the output of calling the given function once for every entity in this selection.
a function to call once, for each entity
optional argument, the this pointer to use when calling the provided function
an array with the output of the given function, one for each entity
Returns a mirror of this selection. The BitSet that underlies this Selection is shared with this selection.
a new selection, a copy of this selection, that shares a bitset with the original selection.
Removes all the entities in this selection from the associated graph.
this selection
Remove all of the bits in this selection from the given BitSet.
Sets a retention policy for all the entities contained in this selection.
A retention policy is a function that is passed an Entity and returns true if that Entity may not be removed from the graph.
a policy function that will prevent entities from being removed if it returns true.
this selection
Create a sub-selection on this selection, narrowing by the given criteria.
valid query criteria
a new selection which is a sub-set of this selection
Convert this selection to an array of Entitys
Returns a new Selection, that is the union of this selection and the given selection. The new selection is associated with this graph.
the selection to union with this selection. Note, this selection can be associated with a different graph.
a new selection, associated with this graph, containing the union of the two selections.