/** * Returns the actual target of this pointer. * * @return actual target of this pointer * @throws JWNLException JWNLException */ public PointerTarget getTarget() throws JWNLException { if (null == target && null != source.getDictionary()) { Synset syn = source.getDictionary().getSynsetAt(targetIndex.pos, targetIndex.offset); target = (targetIndex.index == 0) ? syn : (null == syn ? null : syn.getWords().get(targetIndex.index - 1)); if (null != target && source.getDictionary().isEditable()) { targetIndex = null; } } return target; }
/** * Returns the actual target of this pointer. * * @return actual target of this pointer * @throws JWNLException JWNLException */ public PointerTarget getTarget() throws JWNLException { if (null == target && null != source.getDictionary()) { Synset syn = source.getDictionary().getSynsetAt(targetIndex.pos, targetIndex.offset); target = (targetIndex.index == 0) ? syn : (null == syn ? null : syn.getWords().get(targetIndex.index - 1)); if (null != target && source.getDictionary().isEditable()) { targetIndex = null; } } return target; }
public Pointer(PointerType pointerType, PointerTarget source, PointerTarget target) { if (null == pointerType) { throw new IllegalArgumentException("Pointer type must be not null"); } this.pointerType = pointerType; if (null == source) { throw new IllegalArgumentException("Source must be not null"); } this.source = source; if (null == target) { throw new IllegalArgumentException("Target must be not null"); } this.target = target; if (source.getDictionary() != target.getDictionary()) { if (null != source.getDictionary()) { throw new IllegalArgumentException(source.getDictionary().getMessages().resolveMessage("DICTIONARY_EXCEPTION_063")); } else { if (null != target.getDictionary()) { throw new IllegalArgumentException(target.getDictionary().getMessages().resolveMessage("DICTIONARY_EXCEPTION_063")); } //else { // should never get there because of null == null above //throw new IllegalArgumentException("Source and target must belong to the same dictionary"); //} } } }
public Pointer(PointerType pointerType, PointerTarget source, PointerTarget target) { if (null == pointerType) { throw new IllegalArgumentException("Pointer type must be not null"); } this.pointerType = pointerType; if (null == source) { throw new IllegalArgumentException("Source must be not null"); } this.source = source; if (null == target) { throw new IllegalArgumentException("Target must be not null"); } this.target = target; if (source.getDictionary() != target.getDictionary()) { if (null != source.getDictionary()) { throw new IllegalArgumentException(source.getDictionary().getMessages().resolveMessage("DICTIONARY_EXCEPTION_063")); } else { if (null != target.getDictionary()) { throw new IllegalArgumentException(target.getDictionary().getMessages().resolveMessage("DICTIONARY_EXCEPTION_063")); } //else { // should never get there because of null == null above //throw new IllegalArgumentException("Source and target must belong to the same dictionary"); //} } } }
public int getTargetIndex() throws JWNLException { if (null == target) { if (null != source.getDictionary() && source.getDictionary().isEditable()) { return getTarget().getIndex(); } else { return targetIndex.index; } } else { return target.getIndex(); } }
public int getTargetIndex() throws JWNLException { if (null == target) { if (null != source.getDictionary() && source.getDictionary().isEditable()) { return getTarget().getIndex(); } else { return targetIndex.index; } } else { return target.getIndex(); } }
public POS getTargetPOS() throws JWNLException { if (null == target) { if (null != source.getDictionary() && source.getDictionary().isEditable()) { return getTarget().getSynset().getPOS(); } else { return targetIndex.pos; } } else { return target.getSynset().getPOS(); } }
public POS getTargetPOS() throws JWNLException { if (null == target) { if (null != source.getDictionary() && source.getDictionary().isEditable()) { return getTarget().getSynset().getPOS(); } else { return targetIndex.pos; } } else { return target.getSynset().getPOS(); } }
/** * Returns the offset of the target synset. * * @return offset of the target synset * @throws JWNLException JWNLException */ public long getTargetOffset() throws JWNLException { if (null == target) { if (null != source.getDictionary() && source.getDictionary().isEditable()) { return getTarget().getSynset().getOffset(); } else { return targetIndex.offset; } } else { return target.getSynset().getOffset(); } }
/** * Returns the offset of the target synset. * * @return offset of the target synset * @throws JWNLException JWNLException */ public long getTargetOffset() throws JWNLException { if (null == target) { if (null != source.getDictionary() && source.getDictionary().isEditable()) { return getTarget().getSynset().getOffset(); } else { return targetIndex.offset; } } else { return target.getSynset().getOffset(); } }
Pointer pointer = super.get(i); try { if (dictionary != pointer.getSource().getDictionary() || null == pointer.getTarget() || dictionary != pointer.getTarget().getDictionary()) { if (null == toDelete) { toDelete = new ArrayList<>();
Pointer pointer = super.get(i); try { if (dictionary != pointer.getSource().getDictionary() || null == pointer.getTarget() || dictionary != pointer.getTarget().getDictionary()) { if (null == toDelete) { toDelete = new ArrayList<>();