Examples of YearsActive


Examples of com.echonest.api.v4.YearsActive

                        }
                    }
                });

        for (Artist artist : artists) {
            YearsActive ya = artist.getYearsActive();
            Long earliest = ya.getRange()[0];
            System.out.println(earliest + " " + artist.getName());
        }

    }
View Full Code Here

Examples of com.echonest.api.v4.YearsActive

            return;
        }

        checked.add(artist.getID());

        YearsActive ya = artist.getYearsActive();
        String msg = "";

        yaTries++;

        if (ya.size() > 0) {
            yaFound++;
            int start = ya.getRange(0)[0].intValue();
            int end = ya.getRange(ya.size() - 1)[1] == null ? 2011 : ya
                    .getRange(ya.size() - 1)[1].intValue();

            if (start < 1880L) {
                msg += " too early";
            }

            if (start > 2011L) {
                msg += " too late";
            }

            if (end > 2011) {
                msg += " end too late";
            }

            if (end - start > 70) {
                msg += " probably too long";
            }

            if (start > end) {
                msg += " memento artist";
            }

            if (ya.size() > 5) {
                msg += " many splits";
            }

            for (int i = 0; i < ya.size() - 1; i++) {
                int tstart = ya.getRange(i)[0].intValue();
                int tend = ya.getRange(i)[1] == null ? 2011 : ya.getRange(i)[1]
                        .intValue();
                int nstart = ya.getRange(i + 1)[0].intValue();

                if (tstart >= nstart) {
                    msg += " range overlap";
                }

                if (tend >= nstart) {
                    msg += " range overlap";
                }

                if (tend < start) {
                    msg += " bad single range";
                }
            }

        } else {
            msg += " missing years active";
        }

        if (msg.length() > 0) {
            System.out.printf(" %d %d %d %s %s\n", yaTries, yaFound, yaErrors,
                    artist.getName(), msg);
        }
        if (msg.length() > 0) {
            ya.dump();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.