public interface RelationalTable<F,T>
Modifier and Type | Interface and Description |
---|---|
static class |
RelationalTable.Mode |
static class |
RelationalTable.Weighting |
Modifier and Type | Method and Description |
---|---|
boolean |
add(F from,
T to)
Add a new unweighted relation.
|
boolean |
add(F from,
T to,
double weight)
Add a new weighted relation.
|
Set<T> |
allFrom(F from)
Returns the list of
to objects corresponding to a given from object. |
Map<T,Double> |
allFromWithWeights(F from)
Returns the map of
to objects in the table, with their weights. |
Set<F> |
allTo(T to)
Returns the list of
from objects corresponding to a given to object. |
Map<F,Double> |
allToWithWeights(T to)
Returns the map of
from objects in the table, with their weights. |
F |
from(T to)
Gets the (unique)
from object corresponding to object to . |
RelationalTable.Mode |
getMode() |
RelationalTable.Weighting |
getWeighting() |
boolean |
remove(F from,
T to)
Remove any relationship between
from and to |
int |
size()
Returns the total number of relationships in this table.
|
T |
to(F from)
Gets the (unique)
to object corresponding to object from . |
double |
weightFromTo(F from,
T to)
Returns the weight of the relationship between
from and to
Returns 0.0 if there is no relationship, and 1.0 if there is an unweighted relationship. |
boolean add(F from, T to, double weight)
IllegalArgumentExeption
- if table in unweighted and weight is not 1Set<T> allFrom(F from)
to
objects corresponding to a given from
object.
The natural ordering of the elements will be in decreasing weight.Map<T,Double> allFromWithWeights(F from)
to
objects in the table, with their weights.
The natural ordering of the keys will be by decreasing weight.Set<F> allTo(T to)
from
objects corresponding to a given to
object.
If the table is weighted, the returned list will be returned with the highest
weighting first.Map<F,Double> allToWithWeights(T to)
from
objects in the table, with their weights.
The natural ordering of the keys will be by decreasing weight.F from(T to)
from
object corresponding to object to
.IllegalArgumentException
- if more than one to object corresponds to to
RelationalTable.Mode getMode()
RelationalTable.Weighting getWeighting()
boolean remove(F from, T to)
from
and to
true
if the table contained the relationshipint size()
T to(F from)
to
object corresponding to object from
.IllegalArgumentException
- if more than one to object corresponds to from
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.