/** * Returns the sub frames of the given frame in this specific relation. * * @param frame The super frame. * @return A collection of sub frames for frame. */ public Collection<Frame> getSub(Frame frame) { Collection<Frame> ret = new HashSet<Frame>(); for (FrameRelation frameRelation : this.frameRelations) { if (frameRelation.getSuperFrame().equals(frame)) { ret.add(frameRelation.getSubFrame()); } } return ret; };
/** * Detects, whether a given frame element occurs in this relation * * @param frameElement The frame element to occur * @return true, if the frame element is connected, false otherwise */ public boolean isRelated(FrameElement frameElement) { if (!this.isRelated(frameElement.getFrame())) return false; Frame frame = frameElement.getFrame(); for (FrameRelation frel : this.getFrameRelations()) { if (frel.getSubFrame().equals(frame) || frel.getSuperFrame().equals(frame)) for (FrameElementRelation ferel : frel.getFrameElementRelations()) { if (ferel.getSubFrameElement().equals(frameElement) || ferel.getSuperFrameElement().equals(frameElement)) return true; } } return false; }
/** * Detects, whether a given frame occurs in this relation * * @param frame The frame ti occur * @return true, if the frame is connected, false otherwise */ public boolean isRelated(Frame frame) { for (FrameRelation frel : this.getFrameRelations()) { if (frel.getSubFrame().equals(frame) || frel.getSuperFrame().equals(frame)) return true; } return false; }