|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
org.zedlib.HashSet
org.zedlib.HashRel
org.zedlib.HashFun
org.zedlib.HashSeq
A sequence is a type of function that maps an integer (usually representing an ordering) to
an object.
Example: S = { (1,fred), (2,tom), (3,mary) } is a valid sequence.
| Constructor Summary | |
HashSeq()
|
|
HashSeq(Collection c)
Constructs a sequence by iterating over a given collection. |
|
HashSeq(Sequence s)
Construct a sequence from an existing sequence. |
|
| Method Summary | |
void |
add(int index,
Object y)
Adds an (integer, object) pair representing a maplet to this function. |
boolean |
add(Maplet m)
Adds a maplet to this sequence. |
boolean |
add(Object y)
Adds an object to the end of this sequence. |
void |
add(Seqlet m)
Adds a seqlet to this sequence. |
boolean |
addAll(int index,
Collection c)
|
boolean |
containsKey(int key)
A convenience function for the alternative domain().contains(new Integer(key)). |
Sequence |
front()
Returns a sequence being all but the last element in the sequence. |
Object |
get(int key)
Returns the value that a given key maps to. |
protected Set |
getInstance()
|
protected Set |
getInstance(Set s)
|
Seqlet |
getSeqlet(int key)
Returns the maplet that a given key participates in. |
Object |
head()
Returns the first element in the sequence. |
int |
indexOf(Object o)
Searches for the first occurence of the given argument, testing for equality using the equals method. |
Object |
last()
Returns the last element in the sequence. |
int |
lastIndexOf(Object o)
Returns the index of the last occurrence of the specified object in this list. |
ListIterator |
listIterator()
|
ListIterator |
listIterator(int index)
|
Object |
put(Maplet m)
Replaces a maplet in this sequence. |
Object |
remove(int key)
Removes the maplet with the given key from this function. |
Object |
set(int index,
Object y)
Adds an (integer, object) pair representing a maplet to this function. |
List |
subList(int fromIndex,
int toIndex)
|
Sequence |
tail()
Returns a sequence being all but the first element in the sequence. |
| Methods inherited from class org.zedlib.HashFun |
containsKey, containsValue, getMaplet, getValue, put |
| Methods inherited from class org.zedlib.HashRel |
add, addAll, addAll, buildRelation, composition, domain, domainAntiRestriction, domainRestriction, image, inverse, isFunction, isInjection, isReflexive, override, range, rangeAntiRestriction, rangeRestriction, toString, transitiveClosure |
| Methods inherited from class org.zedlib.HashSet |
cartesianProduct, difference, difference, identity, intersection, intersection, isProperSubsetOf, isSubsetOf, isSupersetOf, union, union |
| Methods inherited from class java.util.HashSet |
clear, clone, contains, isEmpty, iterator, remove, size |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
containsAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zedlib.Function |
containsKey, containsValue, getMaplet |
| Methods inherited from interface org.zedlib.Relation |
add, addAll, composition, domain, domainAntiRestriction, domainRestriction, image, inverse, isFunction, isInjection, isReflexive, override, range, rangeAntiRestriction, rangeRestriction, transitiveClosure |
| Methods inherited from interface org.zedlib.Set |
cartesianProduct, difference, identity, intersection, isSubsetOf, isSupersetOf, union |
| Methods inherited from interface java.util.Set |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.util.List |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
public HashSeq()
public HashSeq(Collection c)
public HashSeq(Sequence s)
| Method Detail |
protected Set getInstance()
getInstance in class HashFunprotected Set getInstance(Set s)
getInstance in class HashFunpublic Object head()
head in interface Sequencepublic Sequence tail()
tail in interface Sequencepublic Object last()
last in interface Sequencepublic Sequence front()
front in interface Sequencepublic Object get(int key)
get in interface Listkey - the key with which to obtain its corresponding value
public Seqlet getSeqlet(int key)
getSeqlet in interface Sequencekey - the key with which to obtain its corresponding value
nullpublic boolean containsKey(int key)
Sequencedomain().contains(new Integer(key)).
containsKey in interface Sequencekey - the key to check
true if the key is contained in the domain of
this functionRelation.domain()public void add(Seqlet m)
add in interface Sequencem - the seqlet to add to this sequence
true if the object was added to this sequence
ClassCastException - if the key of the maplet is not an IntegerSet.add(Object o)public boolean add(Maplet m)
add in interface Relationadd in class HashFunm - the maplet to add to the function
true if the object was added to this sequence
ClassCastException - if the key of the maplet is not an Integerpublic Object remove(int key)
remove in interface Listkey - the key that identifies the maplet to remove
null
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
public void add(int index,
Object y)
add in interface Listindex - the position to add the objecty - the object to add; y in the seqlet (x,y)public boolean add(Object y)
add in interface Setadd in class HashRely - the object to add to the sequence
true if the object was added
public Object set(int index,
Object y)
set in interface Listindex - the position to add the object; x in the maplet (x,y)y - the object to add; y in the maplet (x,y)
null if
there was no maplet having a key of x in this functionpublic Object put(Maplet m)
put in interface Functionput in class HashFunm - the maplet to add to the function
null if
there was no maplet having a key of x in the function.public ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface List
public List subList(int fromIndex,
int toIndex)
subList in interface List
public boolean addAll(int index,
Collection c)
addAll in interface Listpublic int indexOf(Object o)
indexOf in interface ListList.indexOf(java.lang.Object)public int lastIndexOf(Object o)
lastIndexOf in interface ListList.lastIndexOf(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||