/** Creates a new Score with the given setup and data. * * @param setup the ScoreSetup for this score. * @param data the ScoreData for this score. It is an error if * this already belongs to a Score object. * @throws HeirarchyException if the data argument has already * been added to a Score */ public Score(ScoreSetup setup, ScoreData data) { if (data.getParentScore() != null) throw new HeirarchyException ("Cannot add ScoreData to Score because it already belongs to a Score object."); _setup = setup; _data = data; _data.setParentScore(this); }
/** Creates a new Score with the given setup and data. * * @param setup the ScoreSetup for this score. * @param data the ScoreData for this score. It is an error if * this already belongs to a Score object. * @throws HeirarchyException if the data argument has already * been added to a Score */ public Score(ScoreSetup setup, ScoreData data) { if (data.getParentScore() != null) { throw new HeirarchyException ("Cannot add ScoreData to Score because it already belongs to a Score object."); } _setup = setup; _data = data; _data.setParentScore(this); }
/** Creates new ScoreData from the parentInput's input stream. * The next object in the input stream must be of this type. * * @param parentInput the parent RIFF object being used to read the input stream */ public static ScoreData newInstance(Riff parentInput) { Riff riffInput = new Riff(parentInput, "LIST"); riffInput.requireFOURCC(RIFF_ID); ScoreData scoreData = new ScoreData(); while (riffInput.getBytesRemaining() > 0) { // Create the child and call addChild() which will set the child's parent // to this. scoreData.addPage(RiffPage.newInstance(riffInput)); } return scoreData; }
/** Creates new ScoreData from the parentInput's input stream. * The next object in the input stream must be of this type. * * @param parentInput the parent RIFF object being used to read the input stream */ static public ScoreData newInstance(Riff parentInput) { Riff riffInput = new Riff(parentInput, "LIST"); riffInput.requireFOURCC(RIFF_ID); ScoreData scoreData = new ScoreData(); while (riffInput.getBytesRemaining() > 0) { // Create the child and call addChild() which will set the child's parent // to this. scoreData.addPage(RiffPage.newInstance(riffInput)); } return(scoreData); }