private static String getUnitSymbol(URI units) { if (GEOF.UOM_METRE.equals(units)) { return "m"; } else { return ""; } }
@Override public boolean equals(Object o) { if (this == o) return true; return uri.equals(o); }
@Override public boolean equals(Object other) { if (!(other instanceof IndexingExpr)) { return false; } IndexingExpr arg = (IndexingExpr) other; return (this.function.equals(arg.function)) && (this.spConstraint.equals(arg.spConstraint)) && (this.arguments.equals(arg.arguments)); }
public GeoSpatialDatatypeConfiguration getConfigurationForDatatype(URI datatypeUri) { for (int i=0; i<datatypeConfigs.size(); i++) { final GeoSpatialDatatypeConfiguration cur = datatypeConfigs.get(i); if (cur.getUri().equals(datatypeUri)) { return cur; } } return null; // not found/registered }
public GeoSpatialDatatypeConfiguration getConfigurationForDatatype(URI datatypeUri) { for (int i=0; i<datatypeConfigs.size(); i++) { final GeoSpatialDatatypeConfiguration cur = datatypeConfigs.get(i); if (cur.getUri().equals(datatypeUri)) { return cur; } } return null; // not found/registered }
@Override public boolean containsEdge(URI s, URI p, URI o){ for(E e : getE(p, s, Direction.OUT)){ if(e.getTarget().equals(o)) return true; } return false; }
@Override public boolean canInvokeMathOp(final Literal... args) { for (Literal lit : args) { final URI dt = lit.getDatatype(); if (dt == null) return false; if (!(XMLDatatypeUtil.isCalendarDatatype(dt) || dt.equals(XMLSchema.DURATION))) return false; } return true; }
public static RestletUtilRole getRoleByUri(final URI nextUri) { for(final RestletUtilRole nextRole : RestletUtilRoles.values()) { if(nextRole.getURI().equals(nextUri)) { return nextRole; } } return null; }
public SqlAttribute getAttribute(URI predicate) { for (SqlAttribute attr : attributes) { if (predicate.equals(attr.getAttribute().getPredicate())) { return attr; } } return null; }
public void setDateContent(DateTime dateContent) { this.dateContent = dateContent.withMillisOfSecond(0); if(XSD.DateTime.equals(getDatatype())) { this.content = DateUtils.getXMLCalendar(this.dateContent).toXMLFormat(); } else if(XSD.Date.equals(getDatatype())) { this.content = ISODateTimeFormat.date().print(dateContent); } else if(XSD.Time.equals(getDatatype())) { this.content = ISODateTimeFormat.time().print(dateContent); } }
public void setDateContent(DateTime dateContent) { this.dateContent = dateContent.withMillisOfSecond(0); if(XSD.DateTime.equals(getDatatype())) { this.content = DateUtils.getXMLCalendar(this.dateContent).toXMLFormat(); } else if(XSD.Date.equals(getDatatype())) { this.content = ISODateTimeFormat.date().print(dateContent); } else if(XSD.Time.equals(getDatatype())) { this.content = ISODateTimeFormat.time().print(dateContent); } }
public static GoogleCloudSqlBackendType fromURI(URI uri) { for (GoogleCloudSqlBackendType value : values()) { if (value.getURI().equals(uri)) { return value; } } throw new KonigException("Value not found: " + uri.stringValue()); }
public static GoogleCloudSqlInstanceType fromURI(URI uri) { for (GoogleCloudSqlInstanceType value : values()) { if (value.getURI().equals(uri)) { return value; } } throw new KonigException("Value not found: " + uri.stringValue()); }
private ValueExpression literalValue(Literal value) throws ShapeTransformException { URI datatype = value.getDatatype(); if (datatype == null || XMLSchema.STRING.equals(datatype)) { return new StringLiteralExpression(value.stringValue()); } throw new ShapeTransformException(errorMessage("Failed to create literal value: " + value)); }
public static Literal convertLiteral(RyaType literal) { if (XMLSchema.STRING.equals(literal.getDataType())) { return new LiteralImpl(literal.getData()); } else { return new LiteralImpl(literal.getData(), literal.getDataType()); } //TODO: No Language support yet }
@Override public int compare(Statement o1, Statement o2) { if (!o1.getSubject().equals(o2.getSubject())) { return compare(o1.getSubject(), o2.getSubject()); } else if (!o1.getPredicate().equals(o2.getPredicate())) { return compare(o1.getPredicate(), o2.getPredicate()); } else { return compare(o1.getObject(), o2.getObject()); } }
@Override public int compare(Statement o1, Statement o2) { if (!o1.getSubject().equals(o2.getSubject())){ return compare(o1.getSubject(), o2.getSubject()); }else if (!o1.getPredicate().equals(o2.getPredicate())){ return compare(o1.getPredicate(), o2.getPredicate()); }else{ return compare(o1.getObject(), o2.getObject()); } }
public void testLinkSetsIn() { doLoadData(); final ValueFactory vf = om.getValueFactory(); final URI clssuri = vf.createURI("gpo:#1"); IGPO clssgpo = om.getGPO(clssuri); final URI linkURI = vf.createURI("attr:/type"); ILinkSet ls = clssgpo.getLinksIn(linkURI); assertTrue(ls.getOwner() == clssgpo); assertTrue(ls.isLinkSetIn()); assertTrue(ls.getLinkProperty().equals(linkURI)); checkLinkSet(ls, 2); }
public void testLinkSetsIn() { doLoadData(); final ValueFactory vf = om.getValueFactory(); final URI clssuri = vf.createURI("gpo:#1"); IGPO clssgpo = om.getGPO(clssuri); final URI linkURI = vf.createURI("attr:/type"); ILinkSet ls = clssgpo.getLinksIn(linkURI); assertTrue(ls.getOwner() == clssgpo); assertTrue(ls.isLinkSetIn()); assertTrue(ls.getLinkProperty().equals(linkURI)); checkLinkSet(ls, 2); }