<commit_before>package org.intermine.bio.web.displayer;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.intermine.api.InterMineAPI;
import org.intermine.model.InterMineObject;
import org.intermine.util.DynamicUtil;
import org.intermine.web.displayer.ReportDisplayer;
import org.intermine.web.logic.config.ReportDisplayerConfig;
import org.intermine.web.logic.results.ReportObject;

public class SequenceFeatureDisplayer extends ReportDisplayer {

    /** @var sets the max number of locations to show in a table, TODO: match with DisplayObj*/
    private Integer maximumNumberOfLocations = 27;

    public SequenceFeatureDisplayer(ReportDisplayerConfig config, InterMineAPI im) {
        super(config, im);
    }

    @SuppressWarnings("unchecked")
    public void display(HttpServletRequest request, ReportObject reportObject) {
        InterMineObject imObj = reportObject.getObject();
        Object loc = null;



        try {
            loc = imObj.getFieldValue("chromosomeLocation");
            // if the chromosomeLocation reference is null iterate over the contents of the
            //  locations collection and display each location where the locatedOn reference points
            //  to a Chromosome object
            if (loc == null) {
                Collection col = (Collection) imObj.getFieldValue("locations");
                List results = new ArrayList();
                Integer i = 0;
                for (Object item : col) {
                    // early exit
                    if (i == maximumNumberOfLocations) {
                        break;
                    }

                    InterMineObject imLocation = (InterMineObject) item;
                    // fetch where this object is located
                    Object locatedOnObject = imLocation.getFieldValue("locatedOn");<commit_msg>checkstyle<commit_after>package org.intermine.bio.web.displayer;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.intermine.api.InterMineAPI;
import org.intermine.model.InterMineObject;
import org.intermine.util.DynamicUtil;
import org.intermine.web.displayer.ReportDisplayer;
import org.intermine.web.logic.config.ReportDisplayerConfig;
import org.intermine.web.logic.results.ReportObject;

/**
 * Displayer for gene sequence feature
 * @author rns, radek
 *
 */
public class SequenceFeatureDisplayer extends ReportDisplayer
{
    /** @var sets the max number of locations to show in a table, TODO: match with DisplayObj*/
    private Integer maximumNumberOfLocations = 27;

    /**
     * Construct with config and the InterMineAPI.
     * @param config to describe the report displayer
     * @param im the InterMine API
     */
    public SequenceFeatureDisplayer(ReportDisplayerConfig config, InterMineAPI im) {
        super(config, im);
    }

    @Override
    @SuppressWarnings("unchecked")
    public void display(HttpServletRequest request, ReportObject reportObject) {
        InterMineObject imObj = reportObject.getObject();
        Object loc = null;



        try {
            loc = imObj.getFieldValue("chromosomeLocation");
            // if the chromosomeLocation reference is null iterate over the contents of the
            //  locations collection and display each location where the locatedOn reference points
            //  to a Chromosome object
            if (loc == null) {
                Collection col = (Collection) imObj.getFieldValue("locations");
                List results = new ArrayList();
                Integer i = 0;
                for (Object item : col) {
                    // early exit
                    if (i == maximumNumberOfLocations) {
                        break;
                    }

                    InterMineObject imLocation = (InterMineObject) item;
                    // fetch where this object is located
                    Object locatedOnObject = imLocation.getFieldValue("locatedOn");
{'fraction_non_alphanumeric': 0.07780979827089338, 'fraction_numerical': 0.001440922190201729, 'mean_word_length': 2.5177364864864864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6963432', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1018, 'n_words': 298}