Class TermSchema
java.lang.Object
edu.harvard.seas.pl.abcdatalog.engine.topdown.TermSchema
A list of terms of fixed arity representing the attribute schema for a relation of the same arity
(i.e., the 2nd term in the list is the attribute for the 2nd "column" in the relation).
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTermSchema
(int arity) Constructs a schema of the supplied arity.TermSchema
(TermSchema other) Constructs a schema from another schema.TermSchema
(List<Term> terms) Constructs a schema from a list of terms. -
Method Summary
-
Field Details
-
attributes
The attributes of this schema.
-
-
Constructor Details
-
TermSchema
Constructs a schema from a list of terms.- Parameters:
terms
- the terms
-
TermSchema
Constructs a schema from another schema.- Parameters:
other
- the other schema
-
TermSchema
public TermSchema(int arity) Constructs a schema of the supplied arity. The attributes are given unique but arbitrary names.- Parameters:
arity
- the arity
-
-
Method Details
-
get
Returns the term at the given index into the schema.- Parameters:
i
- the index- Returns:
- the term
-
get
Returns the index of the given term in the schema. If the term appears multiple times in the schema, returns the first position.- Parameters:
t
- the term- Returns:
- the index
-
size
public int size()Returns the size of this schema.- Returns:
- the size
-
toString
-
hashCode
public int hashCode() -
equals
-