/** * Returns true if <var>type</var> is symmetric to this pointer type. * * @param type pointer type * @return true if <var>type</var> is symmetric to this pointer type */ public boolean symmetricTo(PointerType type) { return getSymmetricType() != null && getSymmetricType().equals(type); }
/** * Returns true if <var>type</var> is symmetric to this pointer type. * * @param type pointer type * @return true if <var>type</var> is symmetric to this pointer type */ public boolean symmetricTo(PointerType type) { return getSymmetricType() != null && getSymmetricType().equals(type); }
/** * Returns whether <var>that</var> is symmetric to this pointer. * @param that pointer * @return true, if <var>that</var> is symmetric to this pointer. * @throws JWNLException JWNLException */ public boolean isSymmetricTo(Pointer that) throws JWNLException { return null != pointerType.getSymmetricType() && that.getType().equals(pointerType.getSymmetricType()) && that.getTarget().equals(getSource()) && that.getSource().equals(getTarget()); }
/** * Returns whether <var>that</var> is symmetric to this pointer. * @param that pointer * @return true, if <var>that</var> is symmetric to this pointer. * @throws JWNLException JWNLException */ public boolean isSymmetricTo(Pointer that) throws JWNLException { return null != pointerType.getSymmetricType() && that.getType().equals(pointerType.getSymmetricType()) && that.getTarget().equals(getSource()) && that.getSource().equals(getTarget()); }
private void addSymmetricPointerToTarget(Pointer original) { if (null != original.getType().getSymmetricType()) { try { boolean found = false; for (Pointer p : original.getTargetSynset().getPointers()) { if (p.isSymmetricTo(original)) { found = true; break; } } if (!found) { Pointer symmetric = new Pointer(original.getType().getSymmetricType(), original.getTarget(), original.getSource()); original.getTargetSynset().getPointers().add(symmetric); } } catch (JWNLException e) { throw new JWNLRuntimeException(e); } } }
private void deleteSymmetricPointerFromTarget(Pointer original) { if (null != original.getType().getSymmetricType()) { try { for (Pointer p : original.getTargetSynset().getPointers()) { if (p.isSymmetricTo(original)) { original.getTargetSynset().getPointers().remove(p); break; } } } catch (JWNLException e) { throw new JWNLRuntimeException(e); } } }
private void deleteSymmetricPointerFromTarget(Pointer original) { if (null != original.getType().getSymmetricType()) { try { for (Pointer p : original.getTargetSynset().getPointers()) { if (p.isSymmetricTo(original)) { original.getTargetSynset().getPointers().remove(p); break; } } } catch (JWNLException e) { throw new JWNLRuntimeException(e); } } }
private void addSymmetricPointerToTarget(Pointer original) { if (null != original.getType().getSymmetricType()) { try { boolean found = false; for (Pointer p : original.getTargetSynset().getPointers()) { if (p.isSymmetricTo(original)) { found = true; break; } } if (!found) { Pointer symmetric = new Pointer(original.getType().getSymmetricType(), original.getTarget(), original.getSource()); original.getTargetSynset().getPointers().add(symmetric); } } catch (JWNLException e) { throw new JWNLRuntimeException(e); } } }
public Relationship reverse() throws CloneNotSupportedException { PointerTargetNodeList list = getNodeList().deepClone().reverse(); for (Object aList : list) { ((PointerTargetNode) aList).setType(getType().getSymmetricType()); } return new SymmetricRelationship(getType(), list, getSourceSynset(), getTargetSynset()); } }
public Relationship reverse() throws CloneNotSupportedException { PointerTargetNodeList list = getNodeList().deepClone().reverse(); for (Object aList : list) { ((PointerTargetNode) aList).setType(getType().getSymmetricType()); } return new SymmetricRelationship(getType(), list, getSourceSynset(), getTargetSynset()); } }
public Relationship reverse() throws CloneNotSupportedException { PointerTargetNodeList list = getNodeList().deepClone().reverse(); int commonParentIndex = (list.size() - 1) - getCommonParentIndex(); for (int i = 0; i < list.size(); i++) { if (i != commonParentIndex) { list.get(i).setType(getType().getSymmetricType()); } } return new AsymmetricRelationship(getType(), list, commonParentIndex, getSourceSynset(), getTargetSynset()); } }
public Relationship reverse() throws CloneNotSupportedException { PointerTargetNodeList list = getNodeList().deepClone().reverse(); int commonParentIndex = (list.size() - 1) - getCommonParentIndex(); for (int i = 0; i < list.size(); i++) { if (i != commonParentIndex) { list.get(i).setType(getType().getSymmetricType()); } } return new AsymmetricRelationship(getType(), list, commonParentIndex, getSourceSynset(), getTargetSynset()); } }
node.setType(type.getSymmetricType()); relationship.add(node);
node.setType(type.getSymmetricType()); relationship.add(node);