001/* Interface that specifies the way Units, etc are presented. 002 003 Copyright (c) 2003-2014 The Regents of the University of California. 004 All rights reserved. 005 Permission is hereby granted, without written agreement and without 006 license or royalty fees, to use, copy, modify, and distribute this 007 software and its documentation for any purpose, provided that the above 008 copyright notice and the following two paragraphs appear in all copies 009 of this software. 010 011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 015 SUCH DAMAGE. 016 017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 022 ENHANCEMENTS, OR MODIFICATIONS. 023 024 PT_COPYRIGHT_VERSION_3 025 COPYRIGHTENDKEY 026 @Pt.ProposedRating Red (rowland) 027 @Pt.AcceptedRating Red (rowland) 028 */ 029package ptolemy.moml.unit; 030 031////////////////////////////////////////////////////////////////////////// 032//// UnitPresentation 033 034/** The methods necessary to present Units, UnitConstraints, UnitExprs, etc. so 035 that developers, and humans can understand the results generated by the 036 system. 037 @author Rowland R Johnson 038 @version $Id$ 039 @since Ptolemy II 8.0 040 @Pt.ProposedRating Red (cxh) 041 @Pt.AcceptedRating Red (cxh) 042 */ 043public interface UnitPresentation { 044 /** This method generates the descriptive form. 045 * In addition to the internal form used by the system Units, 046 * UnitConstraints, UnitExprs, etc. have a descriptive form that is used by 047 * humans. This method generates that form so that humans can 048 * easily understand the results generated by the system. For example, an 049 * internal representation of a Unit could be 4.1868E7*<2, 1, 1, 0, 0> 050 * and its descriptive form would be "calorie". 051 * <p> 052 * The descriptive form is invariant across Unit Systems. That is, calorie 053 * is calorie regardless of the Unit System. But, the internal form may be 054 * 4.1868E7*<2, 1, 1, 0, 0> in one Unit System, and 055 * 1.0*<2, 1, 1, 0, 0> in another. Therefore the descriptive form is 056 * used as the external representation. This makes it 057 * possible to save a model under one Unit System, and then load it under a 058 * different Unit System. 059 * @return The descriptive form. 060 */ 061 public String descriptiveForm(); 062 063 @Override 064 public String toString(); 065}