Bases: TASSELpy.java.util.Map.Map, TASSELpy.java.lang.Object.Object
public abstract class AbstractMap<K,V> extends Object implements Map<K,V> This class provides a skeletal implementation of the Map interface, to minimize the effort required to implement this interface. To implement an unmodifiable map, the programmer needs only to extend this class and provide an implementation for the entrySet method, which returns a set-view of the map’s mappings. Typically, the returned set will, in turn, be implemented atop AbstractSet. This set should not support the add or remove methods, and its iterator should not support the remove method.
To implement a modifiable map, the programmer must additionally override this class’s put method (which otherwise throws an UnsupportedOperationException), and the iterator returned by entrySet().iterator() must additionally implement its remove method.
The programmer should generally provide a void (no argument) and map constructor, as per the recommendation in the Map interface specification.
The documentation for each non-abstract method in this class describes its implementation in detail. Each of these methods may be overridden if the map being implemented admits a more efficient implementation.
This class is a member of the Java Collections Framework.
Methods
Entry | |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the mappings from this map |
clone(*args) | Creates and returns a copy of this object |
containsKey(*args) | Returns true if this map contains a mapping for the specified key |
containsValue(*args) | Returns true if this map contains a mapping for the specified value |
entrySet(*args) | Returns a Set view of the mappings contained in this map |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Gets the vlaue to which the specified key is mapped, or null if this map contains no |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this map contains no key-value mappings |
keySet(*args) | Returns a Set view of the keys contained in this map |
put(*args) | Associates the specified value with the specified key in this map |
putAll(*args) | Copies all of the mappings from the specified map to this map |
remove(*args) | Removes the mapping for a key from this map if it is present |
size(*args) | Returns the number of key-value mappings in this map |
toString(*args) | Returns a string representation of the object |
values(*args) | Returns a Collection view of the values contained in this map |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Bases: TASSELpy.java.util.List.List
From docs.oracle.com:
public abstract class AbstractSequentialList<E> extends AbstractList<E>
This class provides a skeletal implementation of the List interface to minimize the effort required to implement this interface backed by a “sequential access” data store (such as a linked list). For random access data (such as an array), AbstractList should be used in preference to this class.
This class is the opposite of the AbstractList class in the sense that it implements the “random access” methods (get(int index), set(int index, E element), add(int index, E element) and remove(int index)) on top of the list’s list iterator, instead of the other way around.
To implement a list the programmer needs only to extend this class and provide implementations for the listIterator and size methods. For an unmodifiable list, the programmer need only implement the list iterator’s hasNext, next, hasPrevious, previous and index methods.
For a modifiable list the programmer should additionally implement the list iterator’s set method. For a variable-size list the programmer should additionally implement the list iterator’s remove and add methods.
The programmer should generally provide a void (no argument) and collection constructor, as per the recommendation in the Collection interface specification.
Methods
add(*args) | Ensures that this collection contains the specified element. |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Returns the element at the specified position in this list |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
indexOf(*args) | Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
lastIndexOf(*args) | Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
listIterator(*args) | Returns a list iterator over the elements in this list |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
set(*args) | Replaces the element at the specified position in this list with |
size(*args) | Returns the number of elements in this collection. |
subList(*args) | REturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Bases: TASSELpy.java.util.List.List
From docs.oracle.com:
public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, Serializable Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list. (This class is roughly equivalent to Vector, except that it is unsynchronized.) The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking). The constant factor is low compared to that for the LinkedList implementation.
Each ArrayList instance has a capacity. The capacity is the size of the array used to store the elements in the list. It is always at least as large as the list size. As elements are added to an ArrayList, its capacity grows automatically. The details of the growth policy are not specified beyond the fact that adding an element has constant amortized time cost.
An application can increase the capacity of an ArrayList instance before adding a large number of elements using the ensureCapacity operation. This may reduce the amount of incremental reallocation.
Note that this implementation is not synchronized. If multiple threads access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list. If no such object exists, the list should be “wrapped” using the Collections.synchronizedList method. This is best done at creation time, to prevent accidental unsynchronized access to the list:
List list = Collections.synchronizedList(new ArrayList(...));
The iterators returned by this class’s iterator and listIterator methods are fail-fast: if the list is structurally modified at any time after the iterator is created, in any way except through the iterator’s own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.
Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.
This class is a member of the Java Collections Framework.
Methods
add(*args) | Appends specified element to end of list or inserts specified element at given position |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Returns the element at the specified position in this list |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
indexOf(*args) | Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
lastIndexOf(*args) | Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
listIterator(*args) | Returns a list iterator over the elements in this list |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
set(*args) | Replaces the element at the specified position in this list with |
size(*args) | Returns the number of elements in this list |
subList(*args) | REturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Instantiates a wrapped ArrayList object
Signatures:
ArrayList() ArrayList(Collection<? extends E> c) ArrayList(int initialCapacity)
Arguments:
Keyword Arguments:
generic – Python wrapper class specifying types of elements in this arrayList
Bases: TASSELpy.java.util.Collection.metaCollection
From docs.oracle.com:
public interface Collection<E> extends Iterable<E>
The root interface in the collection hierarchy. A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered. The JDK does not provide any direct implementations of this interface: it provides implementations of more specific subinterfaces like Set and List. This interface is typically used to pass collections around and manipulate them where maximum generality is desired. Bags or multisets (unordered collections that may contain duplicate elements) should implement this interface directly.
All general-purpose Collection implementation classes (which typically implement Collection indirectly through one of its subinterfaces) should provide two “standard” constructors: a void (no arguments) constructor, which creates an empty collection, and a constructor with a single argument of type Collection, which creates a new collection with the same elements as its argument. In effect, the latter constructor allows the user to copy any collection, producing an equivalent collection of the desired implementation type. There is no way to enforce this convention (as interfaces cannot contain constructors) but all of the general-purpose Collection implementations in the Java platform libraries comply.
The “destructive” methods contained in this interface, that is, the methods that modify the collection on which they operate, are specified to throw UnsupportedOperationException if this collection does not support the operation. If this is the case, these methods may, but are not required to, throw an UnsupportedOperationException if the invocation would have no effect on the collection. For example, invoking the addAll(Collection) method on an unmodifiable collection may, but is not required to, throw the exception if the collection to be added is empty.
Some collection implementations have restrictions on the elements that they may contain. For example, some implementations prohibit null elements, and some have restrictions on the types of their elements. Attempting to add an ineligible element throws an unchecked exception, typically NullPointerException or ClassCastException. Attempting to query the presence of an ineligible element may throw an exception, or it may simply return false; some implementations will exhibit the former behavior and some will exhibit the latter. More generally, attempting an operation on an ineligible element whose completion would not result in the insertion of an ineligible element into the collection may throw an exception or it may succeed, at the option of the implementation. Such exceptions are marked as “optional” in the specification for this interface.
It is up to each collection to determine its own synchronization policy. In the absence of a stronger guarantee by the implementation, undefined behavior may result from the invocation of any method on a collection that is being mutated by another thread; this includes direct invocations, passing the collection to a method that might perform invocations, and using an existing iterator to examine the collection.
Many methods in Collections Framework interfaces are defined in terms of the equals method. For example, the specification for the contains(Object o) method says: “returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).” This specification should not be construed to imply that invoking Collection.contains with a non-null argument o will cause o.equals(e) to be invoked for any element e. Implementations are free to implement optimizations whereby the equals invocation is avoided, for example, by first comparing the hash codes of the two elements. (The Object.hashCode() specification guarantees that two objects with unequal hash codes cannot be equal.) More generally, implementations of the various Collections Framework interfaces are free to take advantage of the specified behavior of underlying Object methods wherever the implementor deems it appropriate.
This interface is a member of the Java Collections Framework.
Methods
add(*args) | Ensures that this collection contains the specified element. |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
size(*args) | Returns the number of elements in this collection. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Ensures that this collection contains the specified element. Returns true if this collection changed as a result of the call. Returns false if this collection does not permit duplicates and already contains the specified element.
Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.
Signatures:
boolean add(E e)
Arguments:
e – element whose presence in this collection is to be ensured
throws:
UnsupportedOperationException – if the add operation is not supported by this collection ClassCastException – if the class of the specified element presents it from being added to this collection NullPointerException – if the specified element is null and this collection does not permit null elements IllegalArgumentException – if some property of the element prevents it from being added to this collection IllegalStateException – if the element cannot be added at this time due to insertion restrictions
Adds all of the elements in the specified collection to this collection.
Signatures:
boolean addAll(Collection<? extends E> c
Arguments:
c – The collection you want to add
Returns:
true if collection changed as a result of the call
Removes all of the elements from this collection. The collection will be empty after this method returns
Signatures:
void clear()
Throws:
UnsupportedOperationException – if clear operation not supported by this collection
Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o == null ? e == null: o.equals(e))
Signature: | contains (Object o) |
---|---|
Parameters: | o (Object) – element whose presence in this collection is to be tested |
Returns: | true if this collection contains the specified element |
Return type: | boolean |
Returns true if this collection contains all of the elements in the specified collection
Signatures:
boolean constainsAll(Collection<?> c)
Arguments:
c – collection to be checked for containment in this collection
Returns:
true if this collection contains all of the elements in the specified collection
Throws:
Returns true if this collection contains no elements
Signature: | isEmpty () |
---|---|
Returns: | true if this collection contains no elements |
Return type: | boolean |
Removes a single instance of the specified element from this collection, if it is present. More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).
Arguments:
boolean remove(Object o)
Arguments:
o – element to be removed from this collection
Returns:
true if an element was removed as a result of this call
Throws:
ClassCastException – if the type of the specified element is incompatible with this collection NullPointerException – if the specified element is nujll and this collection does not permit null elements UnsupportedOperationException – if the remove operation is not supported by this collection
Removes all of this collection’s elements that are also contained in the specified collection. After this call returns, this collection will contain no elements in common with the specified collection
Signatures:
boolean removeAll(Collection<?> c)
Arguments:
c – collection containing elements to be removed from this collection
Returns:
true if this collection changed as a result of the call
Throws:
UnsupportedOperationException – if the removeAll method is not supported by this collection ClassCastException – if the types of one or more elements in this collection are incompatible
with the specified collection
Retains only the elements in this collection that are contained in the specified collection. In other words, removes from this collection all of its elements that are not contained in the specified collection
Signatures:
boolean retainAll(Collection<?> c)
Arguments:
c – collection containing elements to be retained in this collection
Returns:
true if this collection changed as a result of the call
Throws:
UnsupportedOperationException – if the retainAll operation is not supported by this collection ClassCastException – if the types of one or more of the elemtns in the collection are icompatible
with the specified collection
Returns the number of elements in this collection. If the collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE
Signature: | size () |
---|---|
Returns: | the number of elements in this collection |
Return type: | int |
Returns an array containing all of the elements in this collection. If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. The returned array will be “safe” in that no references to it are maintained in this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
Signatures:
Object[] toArray() <T> T[] toArray(T[] a)
Arguments:
Returns:
An array containing all of the elements in this collection
Throws:
NullPointerException – if the specified array is null
Bases: TASSELpy.java.lang.Iterable.Iterable
Methods
castTo(pyType) | Casts this object to another java/python type |
clone(*args) | Creates and returns a copy of this object |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
iterator(*args) | Returns an iterator over a set of elements of type T |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Bases: TASSELpy.java.util.Queue.Queue
From docs.oracle.com:
public interface Deque<E> extends Queue<E>
A linear collection that supports element insertion and removal at both ends. The name deque is short for “double ended queue” and is usually pronounced “deck”. Most Deque implementations place no fixed limits on the number of elements they may contain, but this interface supports capacity-restricted deques as well as those with no fixed size limit.
This interface defines methods to access the elements at both ends of the deque. Methods are provided to insert, remove, and examine the element. Each of these methods exists in two forms: one throws an exception if the operation fails, the other returns a special value (either null or false, depending on the operation). The latter form of the insert operation is designed specifically for use with capacity-restricted Deque implementations; in most implementations, insert operations cannot fail.
Methods
add(*args) | Inserts the specified element into this queue if it is possible |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
addFirst(*args) | Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions. |
addLast(*args) | Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
descendingIterator(*args) | Returns an iterator over the elements in this deque in reverse sequential order. |
element(*args) | Retrieves, but does not remove, the head of this queue. |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
getFirst(*args) | Retrieves, but does not remove, the first element of this deque. |
getLast(*args) | Retrieves, but does not remove, the last element of this deque. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
offer(*args) | Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. |
offerFirst(*args) | Inserts the specified element at the front of this deque unless it would violate capacity restrictions. |
offerLast(*args) | Inserts the specified element at the end of this deque unless it would violate capacity restrictions. |
peek(*args) | Retrieves, but does not remove, the head of this queue, or returns null if |
peekFirst(*args) | Retrieves, but does not remove, the first element of this deque, |
peekLast(*args) | Retrieves, but does not remove, the last element of this deque, |
poll(*args) | Retrieves and removes the head of this queue, or returns null |
pollFirst(*args) | Retrieves and removes the first element of this deque, or returns |
pollLast(*args) | Retrieves and removes the last element of this deque, or returns |
pop(*args) | Pops an element from the stack represented by this deque. |
push(*args) | Pushes an element onto the stack represented by this deque (in other |
remove(*args) | Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque). |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
removeFirst(*args) | Retrieves and removes the first element of this deque. |
removeFirstOccurrence(*args) | Removes the first occurrence of the specified element from this deque. |
removeLast(*args) | Retrieves and removes the last element of this deque. |
removeLastOccurrence(*args) | Removes the last occurrence of the specified element from this deque. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
size(*args) | Returns the number of elements in this collection. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions. When using a capacity restricted deque, it is generally preferable to use method offerFirst(E).
Signature: | addFirst (E e) |
---|---|
Parameters: | e (E) – the element to add |
Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions. When using a capacity restricted deque, it is generally preferable to use method offerLast(E). This method is equivalent to add(E)
Signature: | addLast (E e) |
---|---|
Parameters: | e (E) – the element to add |
Returns an iterator over the elements in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head)
Signatures:
Iterator<E> descendingIterator()
Returns:
An iterator over the elements in this deque in reverse sequence
Retrieves, but does not remove, the first element of this deque. This method differs from peekFirst only in that it throws an exception if this deque is empty
Signature: | getFirst () |
---|---|
Returns: | the head of this deque |
Return type: | E |
Retrieves, but does not remove, the last element of this deque. This method differs from peekLast only in that it throws an exception of this deque is empty.
Signature: | getLast () |
---|---|
Returns: | The tail of this deque |
Return type: | E |
Inserts the specified element at the front of this deque unless it would violate capacity restrictions. When using a capacity restricted deque, this method is generally preferable to the addFirst(E) method, which can fail to insert an element only by throwing an exception.
Signature: | offerFirst (E e) |
---|---|
Parameters: | e (E) – the element to add |
Returns: | true if the element was added to this deque, else false |
Return type: | boolean |
Inserts the specified element at the end of this deque unless it would violate capacity restrictions. When using a capacity-restricted deque, this method is generally preferable to the addLast(E) method, which can fail to insert an element only by throwing an exception.
Signature: | offerLast (E e) |
---|---|
Parameters: | e (E) – the element to add |
Returns: | true if the element was added to this deque, else false |
Return type: | boolean |
Retrieves, but does not remove, the first element of this deque, or returns null if this deque is empty
Signature: | peekFirst () |
---|---|
Returns: | the head of this deque, or null if this deque is empty |
Return type: | E |
Retrieves, but does not remove, the last element of this deque, or returns null if this deque is empty
Signature: | peekLast () |
---|---|
Returns: | the tail of this deque, or null if this deque is empty |
Return type: | E |
Retrieves and removes the first element of this deque, or returns null if this deque is empty
Signature: | pollFirst () |
---|---|
Returns: | the head of this deque, or null if this deque is empty |
Return type: | E |
Retrieves and removes the last element of this deque, or returns null if this deque is empty
Signature: | pollLast () |
---|---|
Returns: | the tail of this deque, or null if this deque is empty |
Return type: | E |
Pops an element from the stack represented by this deque. In other words, removes and returns the first element of this deque. This method is equivalent to removeFirst()
Signature: | pop () |
---|---|
Returns: | the element at the front of this deque (which is the top of the stack represented by this deque) |
Return type: | E |
Pushes an element onto the stack represented by this deque (in other words, at the head of the deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available This method is equivalent to addFirst(E)
Signature: | push (E e) |
---|---|
Parameters: | e (E) – the element to push |
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque). This method differs from poll only in that it throws an exception if this deque is empty The second removes the first occurrence of the specified element from this deque.
Signature: | remove () |
---|---|
Signature: | remove (Object o) |
Parameters: | o (Object) – element to be removed from this deque, if present |
Returns: | the head of the queue represented by this deque |
Return type: | E |
Retrieves and removes the first element of this deque. This method differs from pollFirst only in that it throws an exception if this deque is empty
Signature: | removeFirst () |
---|---|
Returns: | The head of this deque |
Return type: | E |
Removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the first element e such that (o==null ? e==null : o.equals(e)) (if such an element exists). Returns true if this deque contained the specified element (or equivalently, if this deque changed as a result of the call)
Signature: | removeFirstOccurrence (Object o) |
---|---|
Parameters: | o (Object) – element to be removed from this deque, if present |
Returns: | true if an element was removed as a result of this call |
Return type: | boolean |
Retrieves and removes the last element of this deque. This method differs from pollLast only in that it throws an exception if this deque is empty
Signature: | removeLast () |
---|---|
Returns: | The tail of this deque |
Return type: | E |
Removes the last occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the last element e such that (o==null ? e==null : o.equals(e)) (if such an element exists). Returns true if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).
Signature: | removeLastOccurrence (Object o) |
---|---|
Parameters: | o (Object) – element to be removed from this deque, if present |
Returns: | true if an element was removed as a result of this call |
Return type: | boolean |
Bases: TASSELpy.java.util.List.List
Python-specific class used to apply functional programming filtering to a wrapped java list
Methods
add(*args) | Ensures that this collection contains the specified element. |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
filterEnumerator(filterFunc) | Enumerates the list, returning index and items for which a function |
filterIterator(filterFunc) | Iterates through the list, but only returns items for which a function evaluates True. |
get(*args) | Returns the element at the specified position in this list |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
indexOf(*args) | Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
lastIndexOf(*args) | Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
listIterator(*args) | Returns a list iterator over the elements in this list |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
set(*args) | Replaces the element at the specified position in this list with |
size(*args) | Returns the number of elements in this collection. |
subList(*args) | REturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Bases: TASSELpy.java.util.AbstractMap.AbstractMap
public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable Hash table based implementation of the Map interface. This implementation provides all of the optional map operations, and permits null values and the null key. (The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.) This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time. This implementation provides constant-time performance for the basic operations (get and put), assuming the hash function disperses the elements properly among the buckets. Iteration over collection views requires time proportional to the “capacity” of the HashMap instance (the number of buckets) plus its size (the number of key-value mappings). Thus, it’s very important not to set the initial capacity too high (or the load factor too low) if iteration performance is important.
An instance of HashMap has two parameters that affect its performance: initial capacity and load factor. The capacity is the number of buckets in the hash table, and the initial capacity is simply the capacity at the time the hash table is created. The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased. When the number of entries in the hash table exceeds the product of the load factor and the current capacity, the hash table is rehashed (that is, internal data structures are rebuilt) so that the hash table has approximately twice the number of buckets.
As a general rule, the default load factor (.75) offers a good tradeoff between time and space costs. Higher values decrease the space overhead but increase the lookup cost (reflected in most of the operations of the HashMap class, including get and put). The expected number of entries in the map and its load factor should be taken into account when setting its initial capacity, so as to minimize the number of rehash operations. If the initial capacity is greater than the maximum number of entries divided by the load factor, no rehash operations will ever occur.
If many mappings are to be stored in a HashMap instance, creating it with a sufficiently large capacity will allow the mappings to be stored more efficiently than letting it perform automatic rehashing as needed to grow the table.
Note that this implementation is not synchronized. If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more mappings; merely changing the value associated with a key that an instance already contains is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the map. If no such object exists, the map should be “wrapped” using the Collections.synchronizedMap method. This is best done at creation time, to prevent accidental unsynchronized access to the map:
Map m = Collections.synchronizedMap(new HashMap(...));
The iterators returned by all of this class’s “collection view methods” are fail-fast: if the map is structurally modified at any time after the iterator is created, in any way except through the iterator’s own remove method, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.
Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.
This class is a member of the Java Collections Framework.
Methods
Entry | |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the mappings from this map |
clone(*args) | Creates and returns a copy of this object |
containsKey(*args) | Returns true if this map contains a mapping for the specified key |
containsValue(*args) | Returns true if this map contains a mapping for the specified value |
entrySet(*args) | Returns a Set view of the mappings contained in this map |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Gets the vlaue to which the specified key is mapped, or null if this map contains no |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this map contains no key-value mappings |
keySet(*args) | Returns a Set view of the keys contained in this map |
put(*args) | Associates the specified value with the specified key in this map |
putAll(*args) | Copies all of the mappings from the specified map to this map |
remove(*args) | Removes the mapping for a key from this map if it is present |
size(*args) | Returns the number of key-value mappings in this map |
toString(*args) | Returns a string representation of the object |
values(*args) | Returns a Collection view of the values contained in this map |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Instantiates a HashMap
Signature: | HashMap () |
---|---|
Signature: | HashMap (int initialCapacity) |
Signature: | HashMap (int initialCapacity, float loadFactor) |
Parameters: |
|
Bases: TASSELpy.javaObj.genericJavaObj, TASSELpy.java.lang.Object.Object
From docs.oracle.com:
An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Framework. Iterators differ from enumerations in 2 wyas:
Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
Method names have been improved
Methods
castTo(pyType) | Casts this object to another java/python type |
clone(*args) | Creates and returns a copy of this object |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hasNext(*args) | Returns true if the iteration has more elements. |
hashCode(*args) | Returns a hash code vlaue for the object |
next(*args) | Returns the next element in the iteration |
remove(*args) | Removes from the underlying collection the last element returned by this iterator. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Returns true if the iteration has more elements. (In other words, returns true if next() would return an element rather than throwing an exception.
Signature: | hasNext () |
---|---|
Returns: | true if the iteration has more elements |
Return type: | boolean |
Returns the next element in the iteration
Signatures:
E next()
Returns:
the next element in the iteration
Throws:
NoSuchElementException if iteration has no more elements
Removes from the underlying collection the last element returned by this iterator. The method can be called only once per call to next(). The behavior of an iterator is unspecified if the underlying collection is modified while the itartion is in progress in any way othe rthan by calling this method.
Signatures:
void remove()
Throws:
UnsupportedOperationException – if remove operation is not supported by this iterator IllegalStateException – if the next method has not yet been called, or the remove method
has already been called after the last call to the next method
Bases: TASSELpy.java.util.List.List, TASSELpy.java.util.Deque.Deque
From docs.oracle.com:
public class LinkedList<E> extends AbstractSequentialList<E> implements List<E>, Deque<E>, Cloneable, Serializable
Doubly-linked list implementation of the List and Deque interfaces. Implements all optional list operations, and permits all elements (including null).
All of the operations perform as could be expected for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.
Note that this implementation is not synchronized. If multiple threads access a linked list concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list. If no such object exists, the list should be “wrapped” using the Collections.synchronizedList method. This is best done at creation time, to prevent accidental unsynchronized access to the list:
List list = Collections.synchronizedList(new LinkedList(...));The iterators returned by this class’s iterator and listIterator methods are fail-fast: if the list is structurally modified at any time after the iterator is created, in any way except through the Iterator’s own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.
Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.
Methods
add(*args) | Inserts the specified element into this queue if it is possible |
addAll(*args) | Inserts all the lements in the specified collection into this list. |
addFirst(*args) | Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions. |
addLast(*args) | Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
descendingIterator(*args) | Returns an iterator over the elements in this deque in reverse sequential order. |
element(*args) | Retrieves, but does not remove, the head of this queue. |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Returns the element at the specified position in this list |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
getFirst(*args) | Retrieves, but does not remove, the first element of this deque. |
getLast(*args) | Retrieves, but does not remove, the last element of this deque. |
hashCode(*args) | Returns a hash code vlaue for the object |
indexOf(*args) | Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
lastIndexOf(*args) | Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
listIterator(*args) | Returns a list iterator over the elements in this list |
offer(*args) | Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. |
offerFirst(*args) | Inserts the specified element at the front of this deque unless it would violate capacity restrictions. |
offerLast(*args) | Inserts the specified element at the end of this deque unless it would violate capacity restrictions. |
peek(*args) | Retrieves, but does not remove, the head of this queue, or returns null if |
peekFirst(*args) | Retrieves, but does not remove, the first element of this deque, |
peekLast(*args) | Retrieves, but does not remove, the last element of this deque, |
poll(*args) | Retrieves and removes the head of this queue, or returns null |
pollFirst(*args) | Retrieves and removes the first element of this deque, or returns |
pollLast(*args) | Retrieves and removes the last element of this deque, or returns |
pop(*args) | Pops an element from the stack represented by this deque. |
push(*args) | Pushes an element onto the stack represented by this deque (in other |
remove(*args) | Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque). |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
removeFirst(*args) | Retrieves and removes the first element of this deque. |
removeFirstOccurrence(*args) | Removes the first occurrence of the specified element from this deque. |
removeLast(*args) | Retrieves and removes the last element of this deque. |
removeLastOccurrence(*args) | Removes the last occurrence of the specified element from this deque. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
set(*args) | Replaces the element at the specified position in this list with |
size(*args) | Returns the number of elements in this collection. |
subList(*args) | REturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Constructs a new LinkedList
Signature: | LinkedList () |
---|---|
Parameters: | c – the collection whose elements are to be placed into this list |
Inserts all the lements in the specified collection into this list. Can start at some specified position
Signatures:
boolean addAll(Collection<? extends E> c) boolean addAll(int index, Collection<? extends E> c)
Arguments:
Returns:
true if this list changed as a result of the call
Bases: TASSELpy.java.util.List.metaList
From docs.oracle.com:
public interface List<E> extends Collection<E>
An ordered collection (also known as a sequence). The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list. Unlike sets, lists typically allow duplicate elements. More formally, lists typically allow pairs of elements e1 and e2 such that e1.equals(e2), and they typically allow multiple null elements if they allow null elements at all. It is not inconceivable that someone might wish to implement a list that prohibits duplicates, by throwing runtime exceptions when the user attempts to insert them, but we expect this usage to be rare.
The List interface places additional stipulations, beyond those specified in the Collection interface, on the contracts of the iterator, add, remove, equals, and hashCode methods. Declarations for other inherited methods are also included here for convenience.
The List interface provides four methods for positional (indexed) access to list elements. Lists (like Java arrays) are zero based. Note that these operations may execute in time proportional to the index value for some implementations (the LinkedList class, for example). Thus, iterating over the elements in a list is typically preferable to indexing through it if the caller does not know the implementation.
The List interface provides a special iterator, called a ListIterator, that allows element insertion and replacement, and bidirectional access in addition to the normal operations that the Iterator interface provides. A method is provided to obtain a list iterator that starts at a specified position in the list.
The List interface provides two methods to search for a specified object. From a performance standpoint, these methods should be used with caution. In many implementations they will perform costly linear searches.
The List interface provides two methods to efficiently insert and remove multiple elements at an arbitrary point in the list.
Note: While it is permissible for lists to contain themselves as elements, extreme caution is advised: the equals and hashCode methods are no longer well defined on such a list.
Some list implementations have restrictions on the elements that they may contain. For example, some implementations prohibit null elements, and some have restrictions on the types of their elements. Attempting to add an ineligible element throws an unchecked exception, typically NullPointerException or ClassCastException. Attempting to query the presence of an ineligible element may throw an exception, or it may simply return false; some implementations will exhibit the former behavior and some will exhibit the latter. More generally, attempting an operation on an ineligible element whose completion would not result in the insertion of an ineligible element into the list may throw an exception or it may succeed, at the option of the implementation. Such exceptions are marked as “optional” in the specification for this interface.
This interface is a member of the Java Collections Framework.
Methods
add(*args) | Ensures that this collection contains the specified element. |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Returns the element at the specified position in this list |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
indexOf(*args) | Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
lastIndexOf(*args) | Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
listIterator(*args) | Returns a list iterator over the elements in this list |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
set(*args) | Replaces the element at the specified position in this list with |
size(*args) | Returns the number of elements in this collection. |
subList(*args) | REturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Returns the element at the specified position in this list
Signature: | get (int index) |
---|---|
Parameters: | index (int) – The index of the item you want |
Returns: | The element at the specified position in the list |
Return type: | E |
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index
Signature: | indexOf (Object o) |
---|---|
Parameters: | o (Object) – element to search for |
Returns: | the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element |
Return type: | int |
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index
Signature: | lastIndexOf (Object o) |
---|---|
Parameters: | o (Object) – element to search for |
Returns: | the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element |
Return type: | int |
Returns a list iterator over the elements in this list
Signatures:
ListIterator<E> listIterator() ListIterator<E> listIterator(int index)
Arguments:
Returns:
a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list
Replaces the element at the specified position in this list with the specified element
Signature: | set (int index, E element) |
---|---|
Parameters: |
|
Returns: | the element previously at the specified position |
Return type: | E |
REturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. If they are equal, the returned list is empty). The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.
This method eliminates the need for explicit range operations. Any operation that expects a list can be used as a range operations by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.
Signatures:
List<E> subList(int fromIndex, int toIndex)
Arguments:
fromIndex – low endpoint (inclusive) of the subList toIndex – high endpoint (exclusive) of the subList
Returns:
a view of the specified range within this list
Bases: TASSELpy.java.util.Collection.Collection
Methods
add(*args) | Ensures that this collection contains the specified element. |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
size(*args) | Returns the number of elements in this collection. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Bases: TASSELpy.java.util.Iterator.Iterator
Methods
add(*args) | Inserts the specified element into the list |
castTo(pyType) | Casts this object to another java/python type |
clone(*args) | Creates and returns a copy of this object |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hasNext(*args) | Returns true if the iteration has more elements. |
hasPrevious(*args) | Returns true if this list iterator has more elements when traversing the list |
hashCode(*args) | Returns a hash code vlaue for the object |
next(*args) | Returns the next element in the iteration |
nextIndex(*args) | Returns the index of the element that would be returned by a subsequent call to |
previous(*args) | Returns the previous element in the list and moves the cursor position backwards |
previousIndex(*args) | Returns the index of the element that would be returned by a subsequent call |
remove(*args) | Removes from the underlying collection the last element returned by this iterator. |
set(*args) | Replaces the last element returned by next() or previous() with the specified |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Inserts the specified element into the list
Signature: | add (E e) |
---|---|
Parameters: | e (E) – the element you want to add to the list |
Returns true if this list iterator has more elements when traversing the list in the reverse direction
Signature: | hasPrevious () |
---|---|
Returns: | true if the list iterator has more elements in the reverse direction |
Return type: | boolean |
Returns the index of the element that would be returned by a subsequent call to next()
Signature: | nextIndex () |
---|---|
Returns: | the index of the element that would be returned by a subsequent call to next() |
Return type: | int |
Returns the previous element in the list and moves the cursor position backwards
Signature: | previous () |
---|---|
Returns: | The previous element in the list |
Return type: | E |
Bases: TASSELpy.javaObj.genericJavaObj, TASSELpy.java.lang.Object.Object
An object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value. This interface takes the place of the Dictionary class, which was a totally abstract class rather than an interface.
The Map interface provides three collection views, which allow a map’s contents to be viewed as a set of keys, collection of values, or set of key-value mappings. The order of a map is defined as the order in which the iterators on the map’s collection views return their elements. Some map implementations, like the TreeMap class, make specific guarantees as to their order; others, like the HashMap class, do not.
Note: great care must be exercised if mutable objects are used as map keys. The behavior of a map is not specified if the value of an object is changed in a manner that affects equals comparisons while the object is a key in the map. A special case of this prohibition is that it is not permissible for a map to contain itself as a key. While it is permissible for a map to contain itself as a value, extreme caution is advised: the equals and hashCode methods are no longer well defined on such a map.
All general-purpose map implementation classes should provide two “standard” constructors: a void (no arguments) constructor which creates an empty map, and a constructor with a single argument of type Map, which creates a new map with the same key-value mappings as its argument. In effect, the latter constructor allows the user to copy any map, producing an equivalent map of the desired class. There is no way to enforce this recommendation (as interfaces cannot contain constructors) but all of the general-purpose map implementations in the JDK comply.
The “destructive” methods contained in this interface, that is, the methods that modify the map on which they operate, are specified to throw UnsupportedOperationException if this map does not support the operation. If this is the case, these methods may, but are not required to, throw an UnsupportedOperationException if the invocation would have no effect on the map. For example, invoking the putAll(Map) method on an unmodifiable map may, but is not required to, throw the exception if the map whose mappings are to be “superimposed” is empty.
Some map implementations have restrictions on the keys and values they may contain. For example, some implementations prohibit null keys and values, and some have restrictions on the types of their keys. Attempting to insert an ineligible key or value throws an unchecked exception, typically NullPointerException or ClassCastException. Attempting to query the presence of an ineligible key or value may throw an exception, or it may simply return false; some implementations will exhibit the former behavior and some will exhibit the latter. More generally, attempting an operation on an ineligible key or value whose completion would not result in the insertion of an ineligible element into the map may throw an exception or it may succeed, at the option of the implementation. Such exceptions are marked as “optional” in the specification for this interface.
This interface is a member of the Java Collections Framework.
Many methods in Collections Framework interfaces are defined in terms of the equals method. For example, the specification for the containsKey(Object key) method says: “returns true if and only if this map contains a mapping for a key k such that (key==null ? k==null : key.equals(k)).” This specification should not be construed to imply that invoking Map.containsKey with a non-null argument key will cause key.equals(k) to be invoked for any key k. Implementations are free to implement optimizations whereby the equals invocation is avoided, for example, by first comparing the hash codes of the two keys. (The Object.hashCode() specification guarantees that two objects with unequal hash codes cannot be equal.) More generally, implementations of the various Collections Framework interfaces are free to take advantage of the specified behavior of underlying Object methods wherever the implementor deems it appropriate.
Methods
Entry | |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the mappings from this map |
clone(*args) | Creates and returns a copy of this object |
containsKey(*args) | Returns true if this map contains a mapping for the specified key |
containsValue(*args) | Returns true if this map contains a mapping for the specified value |
entrySet(*args) | Returns a Set view of the mappings contained in this map |
equals(*args) | Indicates whether some other object is “equal to” this one |
get(*args) | Gets the vlaue to which the specified key is mapped, or null if this map contains no |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this map contains no key-value mappings |
keySet(*args) | Returns a Set view of the keys contained in this map |
put(*args) | Associates the specified value with the specified key in this map |
putAll(*args) | Copies all of the mappings from the specified map to this map |
remove(*args) | Removes the mapping for a key from this map if it is present |
size(*args) | Returns the number of key-value mappings in this map |
toString(*args) | Returns a string representation of the object |
values(*args) | Returns a Collection view of the values contained in this map |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Bases: TASSELpy.javaObj.genericJavaObj, TASSELpy.java.lang.Object.Object
A map entry (key-value pair). The Map.entrySet method returns a collection-view of the map, whose elements are of this class. The only way to obtain a reference to a map entry is from the iterator of this collection-view. These Map.Entry objects are valid only for the duration of the iteration; more formally, the behavior of a map entry is undefined if the backing map has been modified after the entry was returned by the iterator, except through the setValue operation on the map entry.
Methods
castTo | |
clone | |
equals | |
getArray | |
getClass | |
getDblArray | |
getKey | |
getValue | |
hashCode | |
setValue | |
toString | |
wrap_existing_array |
Returns the key corresponding to this entry
Signature: | getKey () |
---|---|
Returns: | Key corresponding to this entry |
Return type: | K |
Returns true if this map contains a mapping for the specified key
Signature: | containsKey (Object key) |
---|---|
Parameters: | key (Object) – key whose presence in map is to be tested |
Returns: | True if this map contains a mapping for the specified key |
Return type: | boolean |
Returns true if this map contains a mapping for the specified value
Signature: | containsValue (Object value) |
---|---|
Parameters: | value (Object) – value whose presence in map is to be tested |
Returns: | True if this map contains a mapping for the specified value |
Return type: | boolean |
Returns a Set view of the mappings contained in this map
Signatures:
Set<Map.Entry<K,V>> entrySet()
Returns:
Set view of the mappings contained in this map
Gets the vlaue to which the specified key is mapped, or null if this map contains no mapping for the key
Signature: | get (Object key) |
---|---|
Parameters: | key (Object) – the key whose associated value is to be returned |
Returns: | The value to which the specified key is mapped, or null if htis map contains no mapping for the key |
Return type: | V |
Returns true if this map contains no key-value mappings
Signature: | isEmpty () |
---|---|
Returns: | Whether this map contains any key-value mappings |
Return type: | boolean |
Returns a Set view of the keys contained in this map
Signatures:
Set<K> keySet()
Returns:
Set of the keys in the map
Associates the specified value with the specified key in this map
Signature: | put (K key, V value) |
---|---|
Parameters: |
|
Returns: | Previous value associated with key, or null if there was no mapping for key |
Return type: | V |
Copies all of the mappings from the specified map to this map
Signatures:
void putAll(Map<? extends K, ? extends V> m)
Arguments:
m – Mappings to be stored in this map
Removes the mapping for a key from this map if it is present
Signature: | remove (Object key) |
---|---|
Parameters: | key (Object) – Key for the key-value pair you want to remove |
Returns: | The previous value associated with key, or null if there was no mapping for key |
Return type: | V |
Bases: TASSELpy.java.util.Collection.Collection
From docs.oracle.com:
public interface Queue<E> extends Collection<E>
A collection designed for holding elements prior to processing. Besides basic Collection operations, queues provide additional insertion, extraction, and inspection operations. Each of these methods exists in two forms: one throws an exception if the operation fails, the other returns a special value (either null or false, depending on the operation). The latter form of the insert operation is designed specifically for use with capacity-restricted Queue implementations; in most implementations, insert operations cannot fail.
Methods
add(*args) | Inserts the specified element into this queue if it is possible |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
element(*args) | Retrieves, but does not remove, the head of this queue. |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
offer(*args) | Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. |
peek(*args) | Retrieves, but does not remove, the head of this queue, or returns null if |
poll(*args) | Retrieves and removes the head of this queue, or returns null |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
size(*args) | Returns the number of elements in this collection. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing IllegalStateException if no space is currently available
Signature: | add (E e) |
---|---|
Parameters: | e (E) – the element to add |
Returns: | true |
Return type: | boolean |
Retrieves, but does not remove, the head of this queue. This method differs from peek only in that it throws an exception if this queue is empty
Signature: | element () |
---|---|
Returns: | The head of this queue |
Return type: | E |
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted queue, this method is generally preferable to add(E), which can fail to insert an element only by throwing an exception
Signature: | offer (E e) |
---|---|
Parameters: | e (E) – the element to add |
Returns: | true if the element was added to this queue, else false |
Return type: | boolean |
Bases: TASSELpy.java.util.Collection.Collection
From docs.oracle.com:
public interface Set<E> extends Collection<E> A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element. As implied by its name, this interface models the mathematical set abstraction. The Set interface places additional stipulations, beyond those inherited from the Collection interface, on the contracts of all constructors and on the contracts of the add, equals and hashCode methods. Declarations for other inherited methods are also included here for convenience. (The specifications accompanying these declarations have been tailored to the Set interface, but they do not contain any additional stipulations.)
The additional stipulation on constructors is, not surprisingly, that all constructors must create a set that contains no duplicate elements (as defined above).
Note: Great care must be exercised if mutable objects are used as set elements. The behavior of a set is not specified if the value of an object is changed in a manner that affects equals comparisons while the object is an element in the set. A special case of this prohibition is that it is not permissible for a set to contain itself as an element.
Some set implementations have restrictions on the elements that they may contain. For example, some implementations prohibit null elements, and some have restrictions on the types of their elements. Attempting to add an ineligible element throws an unchecked exception, typically NullPointerException or ClassCastException. Attempting to query the presence of an ineligible element may throw an exception, or it may simply return false; some implementations will exhibit the former behavior and some will exhibit the latter. More generally, attempting an operation on an ineligible element whose completion would not result in the insertion of an ineligible element into the set may throw an exception or it may succeed, at the option of the implementation. Such exceptions are marked as “optional” in the specification for this interface.
This interface is a member of the Java Collections Framework.
Methods
add(*args) | Ensures that this collection contains the specified element. |
addAll(*args) | Adds all of the elements in the specified collection to this collection. |
castTo(pyType) | Casts this object to another java/python type |
clear(*args) | Removes all of the elements from this collection. |
clone(*args) | Creates and returns a copy of this object |
contains(*args) | Returns true if this collection contains the specified element. |
containsAll(*args) | Returns true if this collection contains all of the elements in the specified collection |
equals(*args) | Indicates whether some other object is “equal to” this one |
getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
getClass(*args) | Returns the runtime class of this Object. |
getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
hashCode(*args) | Returns a hash code vlaue for the object |
isEmpty(*args) | Returns true if this collection contains no elements |
iterator(*args) | Returns an iterator over a set of elements of type T |
remove(*args) | Removes a single instance of the specified element from this collection, if it is present. |
removeAll(*args) | Removes all of this collection’s elements that are also contained in the specified collection. |
retainAll(*args) | Retains only the elements in this collection that are contained in the specified collection. |
size(*args) | Returns the number of elements in this collection. |
toArray(*args) | Returns an array containing all of the elements in this collection. |
toString(*args) | Returns a string representation of the object |
wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |