Package es.uam.eps.ir.relison.index.fast
Class FastUnweightedAutoRelation<W>
java.lang.Object
es.uam.eps.ir.relison.index.fast.FastUnweightedRelation<W>
es.uam.eps.ir.relison.index.fast.FastUnweightedAutoRelation<W>
- Type Parameters:
W
- Type of the weights.
- All Implemented Interfaces:
AutoRelation<W>
,Relation<W>
public class FastUnweightedAutoRelation<W> extends FastUnweightedRelation<W> implements AutoRelation<W>
Fast implementation for an unweighted relation of objects with themselves.
-
Field Summary
Fields inherited from class es.uam.eps.ir.relison.index.fast.FastUnweightedRelation
firstIdxList, secondIdxList
-
Constructor Summary
Constructors Constructor Description FastUnweightedAutoRelation()
Constructor.FastUnweightedAutoRelation(java.util.List<java.util.List<java.lang.Integer>> weightList)
Constructor. -
Method Summary
Modifier and Type Method Description java.util.stream.IntStream
firstsWithSeconds()
Obtains the elements in first set with relations to the ones in the second.java.util.stream.IntStream
getIsolated()
Obtains the elements in an autorelation which are related to none.boolean
remove(int idx)
Removes an element.java.util.stream.IntStream
secondsWithFirsts()
Obtains the elements in second set with relations to the ones in the first.Methods inherited from class es.uam.eps.ir.relison.index.fast.FastUnweightedRelation
addFirstItem, addRelation, containsPair, getAllFirst, getIdsFirst, getIdsSecond, getIsolatedFirsts, getIsolatedSeconds, getValue, hasFirsts, hasSeconds, numFirst, numFirst, numSecond, removePair, updatePair
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.relison.index.AutoRelation
addSecondItem, getAllSecond, isIsolated, numSecond, numSecond
Methods inherited from interface es.uam.eps.ir.relison.index.Relation
addFirstItem, addRelation, containsPair, getAllFirst, getIdsFirst, getIdsSecond, getIsolatedFirsts, getIsolatedSeconds, getValue, hasFirsts, hasSeconds, numFirst, numFirst, removePair, updatePair, updatePair
-
Constructor Details
-
FastUnweightedAutoRelation
public FastUnweightedAutoRelation()Constructor. Builds an empty autorelation. -
FastUnweightedAutoRelation
public FastUnweightedAutoRelation(java.util.List<java.util.List<java.lang.Integer>> weightList)Constructor. Builds an autorelation from previous information.- Parameters:
weightList
- List of relations and their weights.
-
-
Method Details
-
getIsolated
public java.util.stream.IntStream getIsolated()Description copied from interface:AutoRelation
Obtains the elements in an autorelation which are related to none.- Specified by:
getIsolated
in interfaceAutoRelation<W>
- Returns:
- an int stream containing the indexes of the items which are related to none.
-
firstsWithSeconds
public java.util.stream.IntStream firstsWithSeconds()Description copied from interface:Relation
Obtains the elements in first set with relations to the ones in the second.- Specified by:
firstsWithSeconds
in interfaceRelation<W>
- Overrides:
firstsWithSeconds
in classFastUnweightedRelation<W>
- Returns:
- the elements in first set with relations to the ones in the second.
-
secondsWithFirsts
public java.util.stream.IntStream secondsWithFirsts()Description copied from interface:Relation
Obtains the elements in second set with relations to the ones in the first.- Specified by:
secondsWithFirsts
in interfaceRelation<W>
- Overrides:
secondsWithFirsts
in classFastUnweightedRelation<W>
- Returns:
- the elements in second set with relations to the ones in the first.
-
remove
public boolean remove(int idx)Description copied from interface:AutoRelation
Removes an element. The identifiers of all remaining elements will be reduced by 1.- Specified by:
remove
in interfaceAutoRelation<W>
- Parameters:
idx
- The identifier of the element.- Returns:
- true if everything went OK, false otherwise.
-