001package components.simplewriter; 002 003/** 004 * Layered implementations of secondary methods for {@code SimpleWriter}. 005 */ 006public abstract class SimpleWriterSecondary implements SimpleWriter { 007 008 /* 009 * Public members --------------------------------------------------------- 010 */ 011 012 /* 013 * Common methods (from Object) ------------------------------------------- 014 */ 015 016 /* 017 * The Object versions of equals and hashCode are not overridden because two 018 * SimpleWriter objects are (known to be) equal iff they are the same 019 * object; it would be too inefficient to remember what the "content" 020 * components of the mathematical models are, so the kernel methods are 021 * incomplete in this respect. On the other hand, toString is overridden 022 * because the other components of the mathematical model are known, though 023 * "content" is not. 024 */ 025 026 // CHECKSTYLE: ALLOW THIS METHOD TO BE OVERRIDDEN 027 @Override 028 public String toString() { 029 StringBuilder result = new StringBuilder("("); 030 result.append(this.isOpen()); 031 result.append(",\""); 032 result.append(this.name()); 033 result.append("\",[contents])"); 034 return result.toString(); 035 } 036 037 /* 038 * Other non-kernel methods ----------------------------------------------- 039 */ 040 041}