public final class CountColumnSpec extends AbstractTableColumnSpec
| Constructor and Description |
|---|
CountColumnSpec(Link[] links) |
CountColumnSpec(String columnNameOverride,
Link[] links,
boolean countUnique)
Constructs a count column spec with an optional header name, the links
to traverse and whether to count the number of unique proposition ids
rather than the number of propositions.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
columnNames(KnowledgeSource knowledgeSource)
Gets the names of the columns representing one instance of a
proposition or property.
|
void |
columnValues(String key,
Proposition proposition,
Map<Proposition,List<Proposition>> forwardDerivations,
Map<Proposition,List<Proposition>> backwardDerivations,
Map<UniqueId,Proposition> references,
KnowledgeSourceCache ksCache,
TabularWriter writer)
Gets the values of the specified propositions or properties for
one row of data.
|
boolean |
equals(Object obj) |
String |
getColumnNameOverride() |
String[] |
getInferredPropositionIds(KnowledgeSource knowledgeSource,
String[] inPropIds)
Infers the ids of the propositions corresponding to the contents of this
column.
|
Link[] |
getLinks() |
int |
hashCode() |
boolean |
isCountUnique() |
void |
validate(KnowledgeSource knowledgeSource)
Validates the fields of this column specification against the
knowledge source.
|
public CountColumnSpec(Link[] links)
public CountColumnSpec(String columnNameOverride, Link[] links, boolean countUnique)
columnNameOverride - an optional header name. Will use a default
that is computed from the specified links (below).links - the links to traverse.countUnique - if true, count the unique ids of the
propositions at the end of the link traversal.public String[] columnNames(KnowledgeSource knowledgeSource) throws KnowledgeSourceReadException
TableColumnSpecknowledgeSource - the active KnowledgeSource.String[] of column names.KnowledgeSourceReadException - if an attempt at reading from
the knowledge source failed.public void columnValues(String key, Proposition proposition, Map<Proposition,List<Proposition>> forwardDerivations, Map<Proposition,List<Proposition>> backwardDerivations, Map<UniqueId,Proposition> references, KnowledgeSourceCache ksCache, TabularWriter writer) throws TabularWriterException
TableColumnSpeckey - a key id String.proposition - a List for the specified
key with the specified proposition id.TabularWriterExceptionpublic void validate(KnowledgeSource knowledgeSource) throws TableColumnSpecValidationFailedException, KnowledgeSourceReadException
TableColumnSpecknowledgeSource - a KnowledgeSource. Guaranteed not
null.KnowledgeSourceReadException - if the knowledge source could
not be read.TableColumnSpecValidationFailedExceptionpublic String getColumnNameOverride()
public Link[] getLinks()
public boolean isCountUnique()
public String[] getInferredPropositionIds(KnowledgeSource knowledgeSource, String[] inPropIds) throws KnowledgeSourceReadException
TableColumnSpecStrings. Guaranteed not
null.KnowledgeSourceReadExceptionCopyright © 2012–2018 Emory University. All rights reserved.