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 // Super-class uses this for toString, equals, and hashCode 023 // There is an optimization, so if this is requested multiple times, it is saved in a 024 // transient field. 025 026 final Object[] asArrayInternal() 027 { 028 throw new UnsupportedOperationException 029 ("Instances of Ret0 do not have any internal fields."); 030 } 031 032 /** 033 * Returns {@code '0'}, indicating how many fields are declared by this class. 034 * @return As an instance of {@code Ret0}, this method returns {@code '0'}; 035 */ 036 public int n() { return 0; } 037 038 /** 039 * This method may not be invoked, or it will throw an exception. 040 * @throws UnsupportedOperationException This class only <I>one <B>singleton</B> instance.</I> 041 */ 042 public final Ret0 clone() 043 { 044 throw new UnsupportedOperationException 045 ("The singleton instance of Ret0 cannot be cloned."); 046 } 047 048 /** 049 * Produces the {@code Ret0} singleton-instance {@code 'toString'} 050 * @return The Java Literal-String {@code "Ret0 Singleton Instance"} 051 */ 052 @Override 053 public final String toString() 054 { return "Ret0 Singleton Instance"; } 055 056 /** 057 * There is only one, singleton, instance of {@code Ret0}, so reference-equality is the only 058 * equality-test. 059 * 060 * @return {@code TRUE} if and only if {@code 'other'} is this class' singleton instance of 061 * {@code Ret0} 062 */ 063 @Override 064 public final boolean equals(Object other) 065 { return this == other; } 066 067 /** 068 * Returns the hash-code for the singleton-instance of {@code Ret0} 069 * @return A nice round-number, 55 to be exact. 070 */ 071 @Override 072 public final int hashCode() 073 { return 55; } 074 075 /** 076 * This method is guaranteed to throw an {@code IndexOutOfBoundsExceptin}. There aren't any 077 * fields that can be retrieved from the {@code Tuple0} Singleton-Instance. 078 * 079 * @param i ignored parameter 080 * @return Does not return anything. Always throws IOOBEX. 081 * @throws IndexOutOfBoundsException Always throws. 082 */ 083 public Object get(int i) 084 { 085 // Always throws Out Of Bounds Exception, Cannot get from Tuple0 086 CHECK_GET(i); 087 088 // The above method should always throw IOOOBEX, this line quiets javac 089 throw new UnreachableError(); 090 } 091 092 public Tuple0 toModifiable() 093 { return Tuple0.T0; } 094}