Package dev.roanh.gmark.core.graph
Class Type
java.lang.Object
dev.roanh.gmark.core.graph.Type
- All Implemented Interfaces:
IDable
Represents a single type in a graph schema.
A type encoded information about the number
of nodes of that specific type in a concrete
graph instance.
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
The textual alias name for this type.private Integer
If this nodes of this type are present in a fixed quantity in a concrete graph instance then this is the number of nodes of this type present in the graph.private final int
The ID of this type.private Double
If this nodes of this type are present as a proportion of all nodes in a concrete graph instance then this is the fraction of nodes of this type present in the graph. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getAlias()
Gets the textual alias name for this type.int
getID()
Gets the unique ID for this object.int
If this nodes of this type are present in a fixed quantity in a concrete graph instance then this gets the number of nodes of this type present in the graph.double
If this nodes of this type are present as a proportion of all nodes in a concrete graph instance then this gets the fraction of nodes of this type present in the graph.int
hashCode()
boolean
Checks if nodes of this type scale in number with the size of the graph.toString()
-
Field Details
-
id
private final int idThe ID of this type. -
alias
The textual alias name for this type. -
fixed
If this nodes of this type are present in a fixed quantity in a concrete graph instance then this is the number of nodes of this type present in the graph. Otherwise this value isnull
. -
proportion
If this nodes of this type are present as a proportion of all nodes in a concrete graph instance then this is the fraction of nodes of this type present in the graph. Otherwise this value isnull
.
-
-
Constructor Details
-
Type
Constructs a new type with the given id, alias and fixed presence quantity.- Parameters:
id
- The ID of this type.alias
- The alias name of this type.fixed
- The number of nodes in a concrete graph instance that are of this type.
-
Type
Constructs a new type with the given id, alias and proportional presence quantity.- Parameters:
id
- The ID of this type.alias
- The alias name of this type.proportion
- The fraction of all nodes in a concrete graph instance that are of this type.
-
-
Method Details
-
isScalable
public boolean isScalable()Checks if nodes of this type scale in number with the size of the graph. If this is false then nodes of this type are instead present in a fixed quantity.- Returns:
- True if nodes of this type are scalable.
-
getNodeCount
public int getNodeCount()If this nodes of this type are present in a fixed quantity in a concrete graph instance then this gets the number of nodes of this type present in the graph.- Returns:
- The number of nodes in a graph instance of this type.
- Throws:
IllegalStateException
- If this type is not present in a fixed quantity.- See Also:
-
getProportion
public double getProportion()If this nodes of this type are present as a proportion of all nodes in a concrete graph instance then this gets the fraction of nodes of this type present in the graph.- Returns:
- The fraction of all nodes in a graph that are of this type.
- Throws:
IllegalStateException
- If this type is not present in a proportional quantity.- See Also:
-
getAlias
Gets the textual alias name for this type.- Returns:
- The alias for this type.
-
getID
public int getID()Description copied from interface:IDable
Gets the unique ID for this object. This ID uniquely identifies all objects of this type. -
toString
-
equals
-
hashCode
public int hashCode()
-