private boolean hasColorTag(Host h) { for (Tag t : h.getTags()) { if (t instanceof ColorTag) { return true; } } return false; }
/** Adds all the tags from h to this host. */ @Override public void addAllTagsOf(Host h) { List<Tag> tags = h.getTags(); if (tags.isEmpty()) { return; } if (mTagList == null) { mTagList = new ArrayList<Tag>(tags.size()); } mTagList.addAll(tags); }
private int getJimpleLnOfHost(Host h) { Iterator<Tag> it = h.getTags().iterator(); while (it.hasNext()) { Tag t = it.next(); if (t instanceof JimpleLineNumberTag) { return ((JimpleLineNumberTag) t).getStartLineNumber(); } } return 0; } }
private int getJimpleLnOfHost(Host h) { Iterator<Tag> it = h.getTags().iterator(); while (it.hasNext()) { Tag t = it.next(); if (t instanceof JimpleLineNumberTag) { return ((JimpleLineNumberTag) t).getStartLineNumber(); } } return 0; }
private int getJavaLnOfHost(Host h) { Iterator<Tag> it = h.getTags().iterator(); while (it.hasNext()) { Tag t = it.next(); if (t instanceof SourceLnPosTag) { return ((SourceLnPosTag) t).startLn(); } else if (t instanceof LineNumberTag) { return (new Integer(((LineNumberTag) t).toString())).intValue(); } } return 0; }
private boolean hasTag(Host h) { if (h instanceof Unit) { Iterator<ValueBox> usesAndDefsIt = ((Unit) h).getUseAndDefBoxes().iterator(); while (usesAndDefsIt.hasNext()) { if (hasTag(usesAndDefsIt.next())) { return true; } } } if (h.getTags().isEmpty()) { return false; } return true; }
private int getJavaLnOfHost(Host h) { Iterator<Tag> it = h.getTags().iterator(); while (it.hasNext()) { Tag t = it.next(); // logger.debug(""+t.getClass().toString()); if (t instanceof SourceLnPosTag) { // logger.debug("t is LineNumberTag"); return ((SourceLnPosTag) t).startLn(); } else if (t instanceof LineNumberTag) { return (new Integer(((LineNumberTag) t).toString())).intValue(); } } return 0; }
/** * Finds a VisibilityAnnotationTag attached to a given Host with the appropriate visibility, or adds one if no such tag is * attached. * * @param h * an Host * @param visibility * a visibility level, taken from soot.tagkit.AnnotationConstants * @return */ private VisibilityAnnotationTag findOrAdd(Host h, int visibility) { ArrayList<VisibilityAnnotationTag> va_tags = new ArrayList<VisibilityAnnotationTag>(); for (Tag t : h.getTags()) { if (t instanceof VisibilityAnnotationTag) { VisibilityAnnotationTag vat = (VisibilityAnnotationTag) t; if (vat.getVisibility() == visibility) { va_tags.add(vat); } } } if (va_tags.isEmpty()) { VisibilityAnnotationTag vat = new VisibilityAnnotationTag(visibility); h.addTag(vat); return vat; } // return the first visibility annotation with the right visibility return (va_tags.get(0)); }
for (Tag t : host.getTags()) {
private boolean hasColorTag(Host h) { Iterator it = h.getTags().iterator(); while (it.hasNext()){ if (it.next() instanceof ColorTag) return true; } return false; }
private boolean hasColorTag(Host h) { Iterator it = h.getTags().iterator(); while (it.hasNext()){ if (it.next() instanceof ColorTag) return true; } return false; }
/** Adds all the tags from h to this host. */ public void addAllTagsOf( Host h ) { for( Iterator<Tag> tIt = h.getTags().iterator(); tIt.hasNext(); ) { final Tag t = tIt.next(); addTag( t ); } } }
/** Adds all the tags from h to this host. */ public void addAllTagsOf( Host h ) { for( Iterator<Tag> tIt = h.getTags().iterator(); tIt.hasNext(); ) { final Tag t = tIt.next(); addTag( t ); } } }
private boolean hasTag(Host h) { if (h instanceof Unit) { Iterator usesAndDefsIt = ((Unit)h).getUseAndDefBoxes().iterator(); while (usesAndDefsIt.hasNext()){ if (hasTag((ValueBox)usesAndDefsIt.next())) return true; } } if (h.getTags().isEmpty()) return false; return true; }
private boolean hasTag(Host h) { if (h instanceof Unit) { Iterator usesAndDefsIt = ((Unit)h).getUseAndDefBoxes().iterator(); while (usesAndDefsIt.hasNext()){ if (hasTag((ValueBox)usesAndDefsIt.next())) return true; } } if (h.getTags().isEmpty()) return false; return true; }