Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package hudson.plugins.violations.model;
 import java.util.Set;
A class contains the violations for a particular file. The number of violations are limited.
public class FileModel extends AbstractFileModel {
        = new TreeMap<StringLimitType>();

Get a map of type to limit type.

the map.
    public SortedMap<StringLimitTypegetLimitTypeMap() {
        return ;

Add summary object for a type of violation.

type the type of violation.
number the number of violations of that type in this file.
suppressed the number of violations not shown for this file.
    public void addLimitType(String typeint numberint suppressed) {
        LimitType l = new LimitType();
        l.type = type;
        l.number = number;
        l.suppressed = suppressed;

Add a violation to the file model.

v the violation to add.
    public void addViolation(Violation v) {
        TreeSet<Violationset = getTypeMap().get(v.getType());
        if (set == null) {
            set = new TreeSet<Violation>();
            getTypeMap().put(v.getType(), set);
        Set<ViolationlineSet = getLineViolationMap().get(v.getLine());
        if (lineSet == null) {
            lineSet = new TreeSet<Violation>();
            getLineViolationMap().put(v.getLine(), lineSet);

A overview class for each type.
    public static class LimitType {
        private String type;
        private int    number;
        private int    suppressed;
Get the type,

the type.
        public String getType() {
            return ;

Get the number of violations.

the number.
        public int getNumber() {
            return ;

Get the number of suppressed violations.

the number.
        public int getSuppressed() {
            return ;
New to GrepCode? Check out our FAQ X