本文整理汇总了Java中org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue.equals方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyIdValue.equals方法的具体用法?Java PropertyIdValue.equals怎么用?Java PropertyIdValue.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue
的用法示例。
在下文中一共展示了PropertyIdValue.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StatementGroupImpl
import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param statements
* a non-empty list of statements that use the same subject and
* main-snak property in their claim
*/
public StatementGroupImpl(List<Statement> statements) {
Validate.notNull(statements, "List of statements cannot be null");
Validate.notEmpty(statements, "List of statements cannot be empty");
EntityIdValue subject = statements.get(0).getClaim().getSubject();
PropertyIdValue property = statements.get(0).getClaim().getMainSnak()
.getPropertyId();
for (Statement s : statements) {
if (!subject.equals(s.getClaim().getSubject())) {
throw new IllegalArgumentException(
"All statements in a statement group must use the same subject");
}
if (!property.equals(s.getClaim().getMainSnak().getPropertyId())) {
throw new IllegalArgumentException(
"All statements in a statement group must use the same main property");
}
}
this.statements = statements;
}
示例2: SnakGroupImpl
import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param snaks
* a non-empty list of snaks that use the same property
*/
SnakGroupImpl(List<? extends Snak> snaks) {
Validate.notNull(snaks, "List of statements cannot be null");
Validate.notEmpty(snaks, "List of statements cannot be empty");
PropertyIdValue property = snaks.get(0).getPropertyId();
for (Snak s : snaks) {
if (!property.equals(s.getPropertyId())) {
throw new IllegalArgumentException(
"All snaks in a snak group must use the same property");
}
}
this.snaks = snaks;
}
示例3: findStatementGroup
import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; //导入方法依赖的package包/类
@Override
public StatementGroup findStatementGroup(PropertyIdValue propertyIdValue) {
for (StatementGroup sg : getStatementGroups()) {
if (propertyIdValue.equals(sg.getProperty())) {
return sg;
}
}
return null;
}
示例4: findStatementGroup
import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; //导入方法依赖的package包/类
/**
* Finds the {@link StatementGroup} for the given property in a document.
*
* @param pid
* the property to look for
* @param document
* the document to search
* @return the {@link StatementGroup} with this property, or null if there
* is none
*/
protected static StatementGroup findStatementGroup(PropertyIdValue pid,
StatementDocument document) {
for (StatementGroup sg : document.getStatementGroups()) {
if (pid.equals(sg.getProperty())) {
return sg;
}
}
return null;
}