Class UsageKnowledge<U>
- java.lang.Object
-
- org.gcube.informationsystem.model.knowledge.UsageKnowledge<U>
-
- Type Parameters:
U- The type of a single usage occurrence.
public class UsageKnowledge<U> extends Object
Tracks, per type name, the list of recorded usage occurrences of a given kind — e.g. whichConsistsOf/IsRelatedTorelations a type participates in, or which types embed a given generic property type.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Constructor Description UsageKnowledge(AccessType accessType)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String typeName, U u)Adds a usage for a type.Set<String>getTypeNames()Returns the names of every type that has at least one recorded usage.List<U>getUsage(String typeName)Returns the usages for a type.voidremove(String typeName, U u)Removes a previously recorded usage for a type, e.g.
-
-
-
Constructor Detail
-
UsageKnowledge
public UsageKnowledge(AccessType accessType)
Creates a new instance.- Parameters:
accessType- The access type.
-
-
Method Detail
-
add
public void add(String typeName, U u)
Adds a usage for a type.- Parameters:
typeName- The type name.u- The usage.
-
remove
public void remove(String typeName, U u)
Removes a previously recorded usage for a type, e.g. when a fallback usage is superseded by an authoritative one.- Parameters:
typeName- The type name.u- The usage to remove.
-
getUsage
public List<U> getUsage(String typeName)
Returns the usages for a type.- Parameters:
typeName- The type name.- Returns:
- The list of usages.
-
-