Class IndexIdMaps
- java.lang.Object
-
- com.jgalgo.graph.IndexIdMaps
-
public class IndexIdMaps extends Object
Static methods class for index-id maps.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntCollectionidToIndexCollection(IntCollection idCollection, IndexIdMap map)Create an indices collection from a collection of IDs.static IntIteratoridToIndexIterator(IntIterator idIter, IndexIdMap map)Create an indices iterator from an iterator of IDs.static WeightFunction.IntidToIndexWeightFunc(WeightFunction.Int w, IndexIdMap map)Create a weight function that accept elements indices, given a weight function that accept elements IDs.static WeightFunctionidToIndexWeightFunc(WeightFunction w, IndexIdMap map)Create a weight function that accept elements indices, given a weight function that accept elements IDs.static Weights.ByteidToIndexWeights(Weights.Byte weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static Weights.CharidToIndexWeights(Weights.Char weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the elements IDs.static Weights.DoubleidToIndexWeights(Weights.Double weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static Weights.FloatidToIndexWeights(Weights.Float weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static Weights.IntidToIndexWeights(Weights.Int weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static Weights.LongidToIndexWeights(Weights.Long weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static Weights.ShortidToIndexWeights(Weights.Short weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static <W> Weights<W>idToIndexWeights(Weights<W> weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.static IntCollectionindexToIdCollection(IntCollection indexCollection, IndexIdMap map)Create an IDs collection from a collection of indices.static EdgeIterindexToIdEdgeIter(EdgeIter indexIter, IndexIdMap verticesMap, IndexIdMap edgesMap)static IntIteratorindexToIdIterator(IntIterator indexIter, IndexIdMap map)Create an IDs iterator from an iterator of indices.static IntListindexToIdList(IntList indexList, IndexIdMap map)Create an IDs list from a list of indices.static Weights.BoolindexWeightsFromWeights(Weights.Bool weights, IndexIdMap map)Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.
-
-
-
Method Detail
-
indexToIdIterator
public static IntIterator indexToIdIterator(IntIterator indexIter, IndexIdMap map)
Create an IDs iterator from an iterator of indices.- Parameters:
indexIter- an iterator of indicesmap- index-id mapping- Returns:
- an iterator that iterate over the IDs matching the indices iterated by the original index-iterator
-
idToIndexIterator
public static IntIterator idToIndexIterator(IntIterator idIter, IndexIdMap map)
Create an indices iterator from an iterator of IDs.- Parameters:
idIter- an iterator of IDsmap- index-id mapping- Returns:
- an iterator that iterate over the indices matching the IDs iterated by the original ID-iterator
-
indexToIdEdgeIter
public static EdgeIter indexToIdEdgeIter(EdgeIter indexIter, IndexIdMap verticesMap, IndexIdMap edgesMap)
-
indexToIdCollection
public static IntCollection indexToIdCollection(IntCollection indexCollection, IndexIdMap map)
Create an IDs collection from a collection of indices.- Parameters:
indexCollection- a collection of indicesmap- index-id mapping- Returns:
- a collection that contain IDs matching the indices contained in the original index-collection
-
idToIndexCollection
public static IntCollection idToIndexCollection(IntCollection idCollection, IndexIdMap map)
Create an indices collection from a collection of IDs.- Parameters:
idCollection- a collection of IDsmap- index-id mapping- Returns:
- a collection that contain indices matching the IDs contained in the original ID-collection
-
indexToIdList
public static IntList indexToIdList(IntList indexList, IndexIdMap map)
Create an IDs list from a list of indices.- Parameters:
indexList- a list of indicesmap- index-id mapping- Returns:
- a list that contain IDs matching the indices contained in the original index-list
-
idToIndexWeights
public static <W> Weights<W> idToIndexWeights(Weights<W> weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Type Parameters:
W- the weight type- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Byte idToIndexWeights(Weights.Byte weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Short idToIndexWeights(Weights.Short weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Int idToIndexWeights(Weights.Int weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Long idToIndexWeights(Weights.Long weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Float idToIndexWeights(Weights.Float weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Double idToIndexWeights(Weights.Double weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
indexWeightsFromWeights
public static Weights.Bool indexWeightsFromWeights(Weights.Bool weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the element IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeights
public static Weights.Char idToIndexWeights(Weights.Char weights, IndexIdMap map)
Create a weights view that is accessed by the elements indices, given a weights container that is accessed by the elements IDs.The returned weights container is a view, namely modifying the original container change the new one, and vice versa.
- Parameters:
weights- a weights container that is accessed by the elements IDsmap- index-id map- Returns:
- a weights-view that is accessed by the elements indices
-
idToIndexWeightFunc
public static WeightFunction idToIndexWeightFunc(WeightFunction w, IndexIdMap map)
Create a weight function that accept elements indices, given a weight function that accept elements IDs.- Parameters:
w- a weight function that accept by elements IDsmap- index-id map- Returns:
- a weight function that accept elements indices
-
idToIndexWeightFunc
public static WeightFunction.Int idToIndexWeightFunc(WeightFunction.Int w, IndexIdMap map)
Create a weight function that accept elements indices, given a weight function that accept elements IDs.- Parameters:
w- a weight function that accept by elements IDsmap- index-id map- Returns:
- a weight function that accept elements indices
-
-