X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FProfiles.java;fp=src%2Fjalview%2Fdatamodel%2FProfiles.java;h=98a8c6de6c8d645019eaaa084ca756c86267d8d8;hb=75d5069a8e8942343a999fe4d474079856fbc5d3;hp=0000000000000000000000000000000000000000;hpb=8b1e1c7cf7bcf6499dad546699c85d8d52e6d86c;p=jalview.git diff --git a/src/jalview/datamodel/Profiles.java b/src/jalview/datamodel/Profiles.java new file mode 100644 index 0000000..98a8c6d --- /dev/null +++ b/src/jalview/datamodel/Profiles.java @@ -0,0 +1,43 @@ +package jalview.datamodel; + +public class Profiles implements ProfilesI +{ + + private ProfileI[] profiles; + + public Profiles(ProfileI[] p) + { + profiles = p; + } + + /** + * Returns the profile for the given column, or null if none found + * + * @param col + */ + @Override + public ProfileI get(int col) + { + return profiles != null && col >= 0 && col < profiles.length ? profiles[col] + : null; + } + + /** + * Returns the first column (base 0) covered by the profiles + */ + @Override + public int getStartColumn() + { + return 0; + } + + /** + * Returns the last column (base 0) covered by the profiles + */ + @Override + public int getEndColumn() + { + return profiles == null ? 0 : profiles.length - 1; + } + +}