本文整理了Java中xdi2.core.util.XDIAddressUtil.removeStartXDIAddress()
方法的一些代码示例,展示了XDIAddressUtil.removeStartXDIAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XDIAddressUtil.removeStartXDIAddress()
方法的具体详情如下:
包路径:xdi2.core.util.XDIAddressUtil
类名称:XDIAddressUtil
方法名:removeStartXDIAddress
[英]Removes a start address from an address. E.g. for =abcd and =ab, this returns cd E.g. for =abcd and (empty address), this returns =abcd E.g. for =abcd and =abcd, this returns (empty address) E.g. for =abcd and =x, this returns null
[中]从地址中删除起始地址。例如,for=abcd和=ab,返回cd例如for=abcd和(空地址),返回=abcd例如for=abcd和=abcd,返回(空地址)例如for=abcd和=x,返回null
代码示例来源:origin: projectdanube/xdi2
/**
* Removes a start address from an address.
* E.g. for =a*b*c*d and =a*b, this returns *c*d
* E.g. for =a*b*c*d and (empty address), this returns =a*b*c*d
* E.g. for =a*b*c*d and =a*b*c*d, this returns (empty address)
* E.g. for =a*b*c*d and =x, this returns null
*/
public static XDIAddress removeStartXDIAddress(final XDIAddress XDIaddress, final XDIAddress startXDIAddress) {
return removeStartXDIAddress(XDIaddress, startXDIAddress, false, false);
}
代码示例来源:origin: projectdanube/xdi2
@Override
public XDIAddress absoluteToRelativeXDIAddress(XDIAddress absoluteAddress) {
XDIAddress relativeAddress = XDIAddressUtil.removeStartXDIAddress(absoluteAddress, this.getContextNode().getXDIAddress());
if (log.isTraceEnabled()) log.trace("absoluteToRelativeAddress(" + absoluteAddress + " --> " + relativeAddress + ")");
return relativeAddress;
}
代码示例来源:origin: projectdanube/xdi2
/**
* Removes a start address from a statement.
* E.g. for =a*b*c*d/&/... and =a*b, this returns *c*d/&/...
*/
public static XDIStatement removeStartXDIStatement(final XDIStatement statement, final XDIAddress start, final boolean variablesInAddress, boolean variablesInStart) {
if (statement == null) throw new NullPointerException();
if (start == null) throw new NullPointerException();
XDIStatement result = null;
try {
XDIAddress subject;
Object predicate;
Object object;
// subject
subject = XDIAddressUtil.removeStartXDIAddress(statement.getSubject(), start, variablesInAddress, variablesInStart);
if (subject == null) { result = null; return result; }
// predicate
predicate = statement.getPredicate();
// object
object = statement.getObject();
{ result = XDIStatement.fromComponents(subject, predicate, object); return result; }
} finally {
if (log.isTraceEnabled()) log.trace("removeStartXDIStatement(" + statement + "," + start + "," + variablesInAddress + "," + variablesInStart + ") --> " + result);
}
}
代码示例来源:origin: projectdanube/xdi2
XDIAddress nextRelativeTargetXDIAddress = relativeTargetXDIAddress == null ? null : XDIAddressUtil.removeStartXDIAddress(relativeTargetXDIAddress, contributorXDIAddress);
XDIAddress nextRelativeNodeXDIAddress = nextRelativeTargetXDIAddress;
代码示例来源:origin: projectdanube/xdi2
public void testRemoveStartXDIAddress() throws Exception {
XDIAddress XDIaddress = XDIAddress.create("=a*b*c*d");
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("")), XDIAddress.create("=a*b*c*d"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("=a")), XDIAddress.create("*b*c*d"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("=a*b")), XDIAddress.create("*c*d"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("=a*b*c")), XDIAddress.create("*d"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("=a*b*c*d")), XDIAddress.create(""));
assertNull(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("=x")));
}
代码示例来源:origin: projectdanube/xdi2
public void DISABLEDtestRemoveStartXDIAddressVariables() throws Exception {
XDIAddress XDIaddress = XDIAddress.create("=a*b+c!d#e$f*g");
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{}"), false, true), XDIAddress.create("*b+c!d#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{=}"), false, true), XDIAddress.create("*b+c!d#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{}{}"), false, true), XDIAddress.create("+c!d#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{=*}}"), false, true), XDIAddress.create("+c!d#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{}{*}"), false, true), XDIAddress.create("+c!d#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{*=}}{{!+}}"), false, true), XDIAddress.create("#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{*=}}{}{!}"), false, true), XDIAddress.create("#e$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{*=}}{}{!}{}"), false, true), XDIAddress.create("$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{*=}}{}{{!}}{#}"), false, true), XDIAddress.create("$f*g"));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{*=}}{}{!}{#}{$}{*}"), false, true), XDIAddress.create(""));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{=+*#$!}}"), false, true), XDIAddress.create(""));
assertNull(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{#}"), false, true));
}
代码示例来源:origin: projectdanube/xdi2
public void DISABLEDtestRemoveEndXDIAddressVariables() throws Exception {
XDIAddress XDIaddress = XDIAddress.create("=a*b+c!d#e$f*g");
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{}"), false, true), XDIAddress.create("=a*b+c!d#e$f"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{*}"), false, true), XDIAddress.create("=a*b+c!d#e$f"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{}{}"), false, true), XDIAddress.create("=a*b+c!d#e"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{{$*}}"), false, true), XDIAddress.create("=a*b+c!d#e"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{$}{}"), false, true), XDIAddress.create("=a*b+c!d#e"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{{!#}}{{$*}}"), false, true), XDIAddress.create("=a*b+c"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{!}{}{{$*}}"), false, true), XDIAddress.create("=a*b+c"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{}{!}{}{{$*}}"), false, true), XDIAddress.create("=a*b"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{+}{{!}}{}{{$*}}"), false, true), XDIAddress.create("=a*b"));
assertEquals(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{=}{*}{+}{!}{}{{$*}}"), false, true), XDIAddress.create(""));
assertEquals(XDIAddressUtil.removeStartXDIAddress(XDIaddress, XDIAddress.create("{{=+*#$!}}"), false, true), XDIAddress.create(""));
assertNull(XDIAddressUtil.removeEndXDIAddress(XDIaddress, XDIAddress.create("{!}"), false, true));
}
}
内容来源于网络,如有侵权,请联系作者删除!