Package dev.roanh.cpqindex
Class LabelSequence
java.lang.Object
dev.roanh.cpqindex.LabelSequence
- All Implemented Interfaces:
Comparable<LabelSequence>
Class representing a sequence of edge labels.
-
Field Summary
Modifier and TypeFieldDescriptionprivate dev.roanh.gmark.core.graph.Predicate[]
An ordered array of the labels that make up the label sequence. -
Constructor Summary
ConstructorDescriptionLabelSequence
(LabelSequence first, LabelSequence last) Constructs a new label sequence by joining the given sequences.LabelSequence
(dev.roanh.gmark.core.graph.Predicate label) Constructs a new label sequence with just a single label.LabelSequence
(DataInputStream in, dev.roanh.gmark.util.RangeList<dev.roanh.gmark.core.graph.Predicate> labels) Reads a label sequence from the given input stream and resolves the corresponding predicates from the given list. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
dev.roanh.gmark.core.graph.Predicate[]
Gets the label in this sequence as an array of predicates.int
hashCode()
toString()
void
write
(DataOutputStream out) Writes this label sequence to the given stream.
-
Field Details
-
data
private dev.roanh.gmark.core.graph.Predicate[] dataAn ordered array of the labels that make up the label sequence.
-
-
Constructor Details
-
LabelSequence
Constructs a new label sequence by joining the given sequences.- Parameters:
first
- The start of the new label sequence.last
- The end of the new label sequence.
-
LabelSequence
public LabelSequence(dev.roanh.gmark.core.graph.Predicate label) Constructs a new label sequence with just a single label.- Parameters:
label
- The single label of the sequence.
-
LabelSequence
public LabelSequence(DataInputStream in, dev.roanh.gmark.util.RangeList<dev.roanh.gmark.core.graph.Predicate> labels) throws IOException Reads a label sequence from the given input stream and resolves the corresponding predicates from the given list.- Parameters:
in
- The stream to read from.labels
- A list with each predicate at its ID position.- Throws:
IOException
- When an IO exception occurs.
-
-
Method Details
-
write
Writes this label sequence to the given stream.- Parameters:
out
- The stream to write to.- Throws:
IOException
- When an IOException occurs.
-
getLabels
public dev.roanh.gmark.core.graph.Predicate[] getLabels()Gets the label in this sequence as an array of predicates.- Returns:
- The labels for this sequence.
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<LabelSequence>
-
hashCode
public int hashCode() -
equals
-