001package Torello.Java.Additional; 002 003import Torello.Java.UnreachableError; 004 005/** 006 * Contains a <B>{@code static}</B> reference to a <B STYLE='color:red'>singleton</B>-instance of 007 * {@code Ret0}. 008 */ 009public class Ret0 010 extends RetN 011 implements java.io.Serializable 012{ 013 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 014 protected static final long serialVersionUID = 1; 015 016 /** This is the singleton instance of this class. */ 017 public static final Ret0 R0 = new Ret0(); 018 019 /** Constructs this object */ 020 private Ret0() { } 021 022 023 // Super-class uses this for toString, equals, and hashCode 024 // There is an optimization, so if this is requested multiple times, it is saved in a 025 // transient field. 026 027 final Object[] asArrayInternal() 028 { 029 throw new UnsupportedOperationException 030 ("Instances of Ret0 do not have any internal fields."); 031 } 032 033 /** 034 * Returns {@code '0'}, indicating how many fields are declared by this class. 035 * @return As an instance of {@code Ret0}, this method returns {@code '0'}; 036 */ 037 public int n() { return 0; } 038 039 /** 040 * This method may not be invoked, or it will throw an exception. 041 * @throws UnsupportedOperationException This class only <I>one <B>singleton</B> instance.</I> 042 */ 043 public final Ret0 clone() 044 { 045 throw new UnsupportedOperationException 046 ("The singleton instance of Ret0 cannot be cloned."); 047 } 048 049 /** 050 * Produces the {@code Ret0} singleton-instance {@code 'toString'} 051 * @return The Java Literal-String {@code "Ret0 Singleton Instance"} 052 */ 053 @Override 054 public final String toString() 055 { return "Ret0 Singleton Instance"; } 056 057 /** 058 * There is only one, singleton, instance of {@code Ret0}, so reference-equality is the only 059 * equality-test. 060 * 061 * @return {@code TRUE} if and only if {@code 'other'} is this class' singleton instance of 062 * {@code Ret0} 063 */ 064 @Override 065 public final boolean equals(Object other) 066 { return this == other; } 067 068 /** 069 * Returns the hash-code for the singleton-instance of {@code Ret0} 070 * @return A nice round-number, 55 to be exact. 071 */ 072 @Override 073 public final int hashCode() 074 { return 55; } 075 076 /** 077 * This method is guaranteed to throw an {@code IndexOutOfBoundsExceptin}. There aren't any 078 * fields that can be retrieved from the {@code Tuple0} Singleton-Instance. 079 * 080 * @param i ignored parameter 081 * @return Does not return anything. Always throws IOOBEX. 082 * @throws IndexOutOfBoundsException Always throws. 083 */ 084 public Object get(int i) 085 { 086 // Always throws Out Of Bounds Exception, Cannot get from Tuple0 087 CHECK_GET(i); 088 089 // The above method should always throw IOOOBEX, this line quiets javac 090 throw new UnreachableError(); 091 } 092 093 public Tuple0 toModifiable() 094 { return Tuple0.T0; } 095}