1 33 34 package edu.rice.cs.drjava.model; 35 import edu.rice.cs.util.UnexpectedException; 36 37 40 public class AlreadyOpenException extends Exception { 41 42 private OpenDefinitionsDocument[] _openDocs; 43 44 public AlreadyOpenException(OpenDefinitionsDocument[] docs) { 45 if (docs.length == 0) { 46 throw new UnexpectedException("This exception can't be constructed with an empty array"); 47 } 48 _openDocs = docs; 49 } 50 51 56 public AlreadyOpenException(OpenDefinitionsDocument doc) { _openDocs = new OpenDefinitionsDocument[] { doc }; } 57 58 61 public OpenDefinitionsDocument getOpenDocument() { return _openDocs[0]; } 62 63 public OpenDefinitionsDocument[] getOpenDocuments() { return _openDocs; } 64 65 } | Popular Tags |