|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.gold.java.AboraHeaper
|
+--org.abora.gold.xpp.basic.Heaper
|
+--org.abora.gold.spaces.basic.Position
|
+--org.abora.gold.tumbler.Sequence
Represents an infinite sequence of integers (of which only a finite number can be
non-zero). They are lexically ordered, and there is a "decimal point" between the numbers
at -1 and 0.
Implementation note:
The array should have no zeros at either end, and noone else should have a pointer to it.
| Field Summary | |
protected PrimIntegerArray |
myNumbers
|
protected IntegerVar |
myShift
|
protected static Sequence |
TheZero
|
| Fields inherited from class org.abora.gold.xpp.basic.Heaper |
AllBlasts, BecomeMap, GarbageCount, InGC, InitializedClasses, InitializingClasses, LastMemory, NextClientRequestNumber, NotOneElementSignal, PackageTable, PromiseNameTable, StringHashSBoxes |
| Fields inherited from class org.abora.gold.java.AboraHeaper |
ActiveClubs, CurrentAuthor, CurrentBertCanopyCache, CurrentBertCrum, CurrentChunk, CurrentGrandMap, CurrentKeyMaster, CurrentPacker, CurrentSensorCanopyCache, CurrentServer, CurrentSession, CurrentSessions, CurrentTrace, InitialEditClub, InitialOwner, InitialReadClub, InitialSponsor, InsideTransactionFlag |
| Constructor Summary | |
Sequence(IntegerVar shift,
PrimIntegerArray numbers)
|
|
Sequence(Rcvr receiver)
|
|
| Method Summary | |
int |
actualHashForEqual()
since we redefine equal, subclasses had better redefine actualHashForEqual |
XnRegion |
asRegion()
Essential. |
int |
comparePrefix(Sequence other,
IntegerVar n)
Compare my numbers up to and including index n with the corresponding numbers in the other Sequence. |
CoordinateSpace |
coordinateSpace()
Essential. |
IntegerVar |
count()
How many numbers in the sequence, not counting leading or trailing zeros |
Sequence |
first()
The sequence consisting of all numbers in this one up to but not including the first zero, or the entire thing if there are no zeros |
IntegerVar |
firstIndex()
The smallest index with a non-zero number. |
static void |
info()
{IntegerVar CLIENT} firstIndex {IntegerVar CLIENT} integerAt: index {IntegerVar} {PrimIntegerArray CLIENT} integers {BooleanVar CLIENT} isZero {IntegerVar CLIENT} lastIndex {Sequence CLIENT} with: index {IntegerVar} with: number {IntegerVar} |
static void |
initTimeNonInherited()
|
IntegerVar |
integerAt(IntegerVar index)
The number at the given index in the Sequence. |
PrimIntegerArray |
integers()
Essential. |
boolean |
isEmpty()
Whether there are no non-zero numbers in the Sequence |
boolean |
isEqual(Heaper other)
Return true if the two objects are equal. |
boolean |
isGE(Position other)
Whether this sequence is greater than or equal to the other sequence, using a lexical comparison of their corresponding numbers. |
boolean |
isZero()
Whether all the numbers in the sequence are zero |
IntegerVar |
lastIndex()
The largest index with a non-zero number. |
static void |
linkTimeNonInherited()
|
Sequence |
minus(Sequence other)
A sequence with the corresponding numbers subtracted from each other |
IntegerVar |
numberAt(IntegerVar index)
|
PrimIntegerArray |
numbers()
|
static Sequence |
numbers(PrimIntegerArray digits)
|
static Sequence |
one(IntegerVar a)
A single element Sequence |
Sequence |
plus(Sequence other)
A sequence with the corresponding numbers added to each other |
static void |
printArrayOn(java.io.PrintWriter oo,
PrimIntegerArray numbers)
Print a sequence of numbers separated by dots. |
void |
printOn(java.io.PrintWriter oo)
|
static void |
printOn(java.io.PrintWriter oo,
IntegerVar shift,
PrimIntegerArray numbers)
Print a sequence of numbers separated by dots. |
static void |
printZerosOn(java.io.PrintWriter oo,
IntegerVar shift)
Print a sequence of zeros separated by dots. |
Sequence |
rest()
The sequence consisting of all numbers in this one after but not including the first zero, or a null sequence if there are no zeros |
PrimIntegerArray |
secretNumbers()
The array itself, for internal use |
void |
sendSelfTo(Xmtr xmtr)
do nothing |
IntegerVar |
shift()
The amount by which the numbers are shifted. |
Sequence |
shift(IntegerVar offset)
Shift the numbers by some number of places. |
static Sequence |
string(java.lang.String string)
|
static Sequence |
three(IntegerVar a,
IntegerVar b,
IntegerVar c)
A three element Sequence |
static Sequence |
two(IntegerVar a,
IntegerVar b)
A two element Sequence |
static Sequence |
usingx(IntegerVar shift,
PrimIntegerArray numbers)
Don't need to make a copy of the array |
Sequence |
with(IntegerVar index,
IntegerVar number)
Change a single element of the sequence. |
Sequence |
withFirst(IntegerVar number)
A Sequence with all my numbers followed by the given one |
Sequence |
withLast(IntegerVar number)
A Sequence with all my numbers followed by the given one |
Sequence |
withRest(Sequence other)
A sequence containing all the numbers in this one, followed by the other one, separated by a single zero. |
static Sequence |
zero()
|
| Methods inherited from class org.abora.gold.spaces.basic.Position |
isAfterOrEqual |
| Methods inherited from class org.abora.gold.java.AboraHeaper |
asOop, basicInspect, displayString, error, hack, halt, inspect, knownBug, mightNotImplement, REQUIRES, shouldImplement, shouldNotImplement, stubbleForSubclassResponsibility, thingToDo, willNotImplement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected IntegerVar myShift
protected PrimIntegerArray myNumbers
protected static Sequence TheZero
| Constructor Detail |
public Sequence(IntegerVar shift,
PrimIntegerArray numbers)
public Sequence(Rcvr receiver)
| Method Detail |
public XnRegion asRegion()
Position
asRegion in class Positionpublic CoordinateSpace coordinateSpace()
Position
coordinateSpace in class Positionpublic IntegerVar count()
public IntegerVar firstIndex()
public IntegerVar integerAt(IntegerVar index)
public PrimIntegerArray integers()
public boolean isZero()
public IntegerVar lastIndex()
public IntegerVar shift()
public int comparePrefix(Sequence other,
IntegerVar n)
public int actualHashForEqual()
Position
actualHashForEqual in class Positionpublic boolean isEqual(Heaper other)
Heaper
isEqual in class Positionpublic boolean isGE(Position other)
isGE in class Positionpublic PrimIntegerArray secretNumbers()
public void printOn(java.io.PrintWriter oo)
printOn in class Heaperpublic Sequence first()
public Sequence minus(Sequence other)
public Sequence plus(Sequence other)
public Sequence rest()
public Sequence shift(IntegerVar offset)
public Sequence with(IntegerVar index,
IntegerVar number)
public Sequence withFirst(IntegerVar number)
public Sequence withLast(IntegerVar number)
public Sequence withRest(Sequence other)
public boolean isEmpty()
public IntegerVar numberAt(IntegerVar index)
public PrimIntegerArray numbers()
public void sendSelfTo(Xmtr xmtr)
Heaper
sendSelfTo in class Heaperpublic static Sequence numbers(PrimIntegerArray digits)
public static Sequence one(IntegerVar a)
public static Sequence string(java.lang.String string)
public static Sequence three(IntegerVar a,
IntegerVar b,
IntegerVar c)
public static Sequence two(IntegerVar a,
IntegerVar b)
public static Sequence zero()
public static void printArrayOn(java.io.PrintWriter oo,
PrimIntegerArray numbers)
public static void printOn(java.io.PrintWriter oo,
IntegerVar shift,
PrimIntegerArray numbers)
public static void printZerosOn(java.io.PrintWriter oo,
IntegerVar shift)
public static Sequence usingx(IntegerVar shift,
PrimIntegerArray numbers)
public static void initTimeNonInherited()
public static void linkTimeNonInherited()
public static void info()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||