|
20080627, rgf | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rexxla.bsf.engines.rexx.Supplier
Class modelled after the ooRexx class "Supplier". Needs the ArrayWrapper
class.
Allows iterating over an array (regardless of its dimension). In the case an entry of the array is
null
, that entry is not reflected in the supplier object.
------------------------ Apache Version 2.0 license ------------------------- Copyright (C) 2001-2007 Rony G. Flatscher Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -----------------------------------------------------------------------------
Field Summary | |
static java.lang.String |
version
Version string indicating version of this class (majorVersion*100+minorVersion concatenated with a dot and the sorted date of last change. |
Constructor Summary | |
Supplier(java.lang.Object arrObject)
Creates an instance of the class using the ArrayWrapper class. |
|
Supplier(java.lang.Object[] values,
java.lang.Object[] indices)
Creates an instance of the class. |
|
Supplier(java.lang.Object arrObject,
boolean bRexxStyle)
Creates an instance of the class using the ArrayWrapper class. |
Method Summary | |
java.lang.Object[] |
allIndexes()
Returns single dimensioned (Java) array object containing the remaining indexes. |
java.lang.Object[] |
allItems()
Returns single dimensioned (Java) array object containing the remaining items. |
boolean |
available()
Tests whether an index/value pair is available. |
boolean |
hasMoreElements()
Implements the interface java.util.Enumeration.hasMoreElements() . |
java.lang.Object |
index()
Returns the index part of the supplier object. |
java.lang.Object |
item()
Returns the item (value) part of the supplier object. |
void |
next()
Move to the next item/value pair, if any. |
java.lang.Object |
nextElement()
Implements the interface java.util.Enumeration.nextElement() . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String version
Constructor Detail |
public Supplier(java.lang.Object arrObject, boolean bRexxStyle)
ArrayWrapper
class.
arrObject
- an array (of any dimension)bRexxStyle
- true
format index-part in Object Rexx style (indexing starts with
1
and multiple indices are delimited with commas), false
format index-part in
Java style (indexing starts with 0
and multiple indices are delimited by
enclosing each index in square brackets)public Supplier(java.lang.Object arrObject)
ArrayWrapper
class. Uses the Java style
of indexing for the index part of the supplier object.
arrObject
- an array (of any dimension)public Supplier(java.lang.Object[] values, java.lang.Object[] indices)
values
- a single-dimensioned array containing the values (items)indices
- a single-dimensioned array containing the indices of v
Method Detail |
public java.lang.Object[] allIndexes()
available()
will return false.
public java.lang.Object[] allItems()
available()
will return false.
public boolean available()
true
, if an index/value pair is available, false
else.public void next()
public java.lang.Object item()
public java.lang.Object index()
public boolean hasMoreElements()
java.util.Enumeration.hasMoreElements()
.
hasMoreElements
in interface java.util.Enumeration
public java.lang.Object nextElement() throws java.util.NoSuchElementException
java.util.Enumeration.nextElement()
.
nextElement
in interface java.util.Enumeration
java.util.NoSuchElementException
- raised, if using the Enumerator interface and moving
beyond the end of the supplier object.
|
20080627, rgf | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |