I
- type of the itemsF
- type of the featuresV
- type of the information about item-feature pairspublic class SimpleFeatureData<I,F,V> extends Object implements FeatureData<I,F,V>
Modifier | Constructor and Description |
---|---|
protected |
SimpleFeatureData(Map<I,List<org.jooq.lambda.tuple.Tuple2<F,V>>> itemMap,
Map<F,List<org.jooq.lambda.tuple.Tuple2<I,V>>> featMap)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsFeature(F f)
Checks whether the index contains a feature.
|
boolean |
containsItem(I i)
Checks whether the index contains an item.
|
Stream<F> |
getAllFeatures()
Retrieves a stream of the indexed features.
|
Stream<I> |
getAllItems()
Retrieves a stream of the indexed items.
|
Stream<org.jooq.lambda.tuple.Tuple2<I,V>> |
getFeatureItems(F f)
Returns a stream of items with the feature.
|
Stream<F> |
getFeaturesWithItems()
Returns a stream of features with items.
|
Stream<org.jooq.lambda.tuple.Tuple2<F,V>> |
getItemFeatures(I i)
Returns a stream of features of the item.
|
Stream<I> |
getItemsWithFeatures()
Returns a stream of items with features.
|
static <I,F,V> SimpleFeatureData<I,F,V> |
load(Stream<org.jooq.lambda.tuple.Tuple3<I,F,V>> tuples)
Loads an instance of the class from a stream of triples.
|
int |
numFeatures()
Counts the number of indexed features.
|
int |
numFeatures(I i)
Returns the number of features of the item.
|
int |
numFeaturesWithItems()
Returns the number of features with items.
|
int |
numItems()
Counts the number of indexed items.
|
int |
numItems(F f)
Returns the number of items with the feature.
|
int |
numItemsWithFeatures()
Returns the number of items with features.
|
public Stream<F> getAllFeatures()
FeatureIndex
getAllFeatures
in interface FeatureIndex<F>
public Stream<I> getAllItems()
ItemIndex
getAllItems
in interface ItemIndex<I>
public Stream<org.jooq.lambda.tuple.Tuple2<I,V>> getFeatureItems(F f)
FeatureData
getFeatureItems
in interface FeatureData<I,F,V>
f
- featurepublic Stream<org.jooq.lambda.tuple.Tuple2<F,V>> getItemFeatures(I i)
FeatureData
getItemFeatures
in interface FeatureData<I,F,V>
i
- itempublic boolean containsFeature(F f)
FeatureIndex
containsFeature
in interface FeatureIndex<F>
f
- featurepublic int numFeatures()
FeatureIndex
numFeatures
in interface FeatureIndex<F>
public int numFeatures(I i)
FeatureData
numFeatures
in interface FeatureData<I,F,V>
i
- itempublic boolean containsItem(I i)
ItemIndex
containsItem
in interface ItemIndex<I>
i
- itempublic int numItems()
ItemIndex
public int numItems(F f)
FeatureData
numItems
in interface FeatureData<I,F,V>
f
- featurepublic int numItemsWithFeatures()
FeatureData
numItemsWithFeatures
in interface FeatureData<I,F,V>
public int numFeaturesWithItems()
FeatureData
numFeaturesWithItems
in interface FeatureData<I,F,V>
public Stream<I> getItemsWithFeatures()
FeatureData
getItemsWithFeatures
in interface FeatureData<I,F,V>
public Stream<F> getFeaturesWithItems()
FeatureData
getFeaturesWithItems
in interface FeatureData<I,F,V>
public static <I,F,V> SimpleFeatureData<I,F,V> load(Stream<org.jooq.lambda.tuple.Tuple3<I,F,V>> tuples)
I
- type of itemF
- type of featV
- type of valuetuples
- stream of item-feat-value triplesCopyright © 2016. All rights reserved.