本文整理匯總了Java中java.util.ArrayList.iterator方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayList.iterator方法的具體用法?Java ArrayList.iterator怎麽用?Java ArrayList.iterator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.ArrayList
的用法示例。
在下文中一共展示了ArrayList.iterator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: pdfBuildSchedulingSubpartRows
import java.util.ArrayList; //導入方法依賴的package包/類
private void pdfBuildSchedulingSubpartRows(Vector subpartIds, ClassAssignmentProxy classAssignment, ExamAssignmentProxy examAssignment, CourseOffering co, SchedulingSubpart ss, String indentSpaces, SessionContext context){
if (subpartIds!=null) subpartIds.add(ss.getUniqueId());
pdfBuildSchedulingSubpartRow(classAssignment, examAssignment, co, ss, indentSpaces, context);
Set childSubparts = ss.getChildSubparts();
if (childSubparts != null && !childSubparts.isEmpty()){
ArrayList childSubpartList = new ArrayList(childSubparts);
Collections.sort(childSubpartList, new SchedulingSubpartComparator());
Iterator it = childSubpartList.iterator();
SchedulingSubpart child = null;
while (it.hasNext()){
child = (SchedulingSubpart) it.next();
pdfBuildSchedulingSubpartRows(subpartIds, classAssignment, examAssignment, co, child, indentSpaces + indent, context);
}
}
}
示例2: appendJoins
import java.util.ArrayList; //導入方法依賴的package包/類
private static void appendJoins(StringBuilder statement, HashMap<String, AssociationPath> explicitJoinsMap) {
ArrayList<AssociationPath> joins = new ArrayList<AssociationPath>(explicitJoinsMap.values());
Collections.sort(joins, new JoinComparator());
Iterator<AssociationPath> it = joins.iterator();
while (it.hasNext()) {
AssociationPath join = it.next();
StringBuilder joinSb = new StringBuilder(" left join ");
joinSb.append(join.getAliasedPathString());
joinSb.append(" as ");
joinSb.append(join.getJoinAlias());
statement.append(joinSb);
}
}
示例3: isTestUserNeeded
import java.util.ArrayList; //導入方法依賴的package包/類
public boolean isTestUserNeeded() {
DefineVariable[] variables=getVariables();
for( int i=0; i<variables.length; i++ ) {
DefineVariable var=variables[i];
if( var.getUserValue()!=null ) {
return true;
} else if( var.getQueryRef()!=null ) {
int refId=var.getQueryRef().getId();
Query query=queryManager.getQuery( refId );
ArrayList values=query.getSqlQuery().getValues();
for( Iterator iter=values.iterator(); iter.hasNext(); ) {
Value v=(Value) iter.next();
if( v instanceof org.ralasafe.db.sql.UserValue ) {
return true;
}
}
}
}
return false;
}
示例4: normalizePositions
import java.util.ArrayList; //導入方法依賴的package包/類
protected ArrayList<LISTITEMVO> normalizePositions(LISTITEM groupItem, ROOT root) throws Exception {
checkRoot(root);
Timestamp now = new Timestamp(System.currentTimeMillis());
User user = CoreUtil.getUser();
long position = CommonUtil.LIST_INITIAL_POSITION;
ArrayList<LISTITEM> items = getItemsSorted(getRootId(root), groupItem);
ArrayList<LISTITEMVO> updated = new ArrayList<LISTITEMVO>(items.size());
Iterator<LISTITEM> it = items.iterator();
while (it.hasNext()) {
LISTITEM item = it.next();
if (getPosition(item) != position) {
checkItem(item);
LISTITEMVO original = toVO(item);
setPosition(item, position);
CoreUtil.modifyVersion(item, item, now, user);
daoUpdate(item);
updated.add(logSystemMessage(item, original, now, user, PositionMovement.NORMALIZE));
}
position += 1L;
}
if (updated.size() > 0) {
logUpdatedPositionsSystemMessage(root, PositionMovement.NORMALIZE, updated, now, user);
}
return updated;
}
示例5: setDefaultSelected
import java.util.ArrayList; //導入方法依賴的package包/類
public void setDefaultSelected(ArrayList<String> resultList) {
if (resultList != null) {
this.mResultList = resultList;
this.mSelectedImages.clear();
Iterator i$ = resultList.iterator();
while (i$.hasNext()) {
Image image = getImageByPath((String) i$.next());
if (image != null) {
this.mSelectedImages.add(image);
}
}
}
}
示例6: prepare
import java.util.ArrayList; //導入方法依賴的package包/類
@Override
protected void prepare() {
// ---------------------------------------
// Automatic regulative constraints
// ---------------------------------------
// Auto disable the N4JS annotation field when definition file (external) is unselected.
if (!getModel().isDefinitionFile() && getModel().isN4jsAnnotated()) {
getModel().setN4jsAnnotated(false);
}
// Auto disable the Internal annotation for the private and project access modifier
if ((getModel().getAccessModifier() == AccessModifier.PRIVATE
|| getModel().getAccessModifier() == AccessModifier.PROJECT) && getModel().isInternal()) {
getModel().setInternal(false);
}
// Auto disable the N4JS annotation for the private access modifier
if (getModel().getAccessModifier() == AccessModifier.PRIVATE) {
getModel().setN4jsAnnotated(false);
}
// Remove interfaces duplicate entries
ArrayList<ClassifierReference> interfaces = new ArrayList<>(getModel().getInterfaces());
Set<String> duplicateFullSpecifiers = Sets.newHashSet();
for (Iterator<ClassifierReference> itr = interfaces.iterator(); itr.hasNext();/**/) {
ClassifierReference next = itr.next();
if (!duplicateFullSpecifiers.add(next.getFullSpecifier())) {
itr.remove();
}
// Also remove empty entries
if (next.classifierName.isEmpty()) {
itr.remove();
}
}
getModel().setInterfaces(interfaces);
}
示例7: ArrayModificationHandler
import java.util.ArrayList; //導入方法依賴的package包/類
/**
* Initialize the ArrayModificationHandler.
* @param array The array this handler will work on. Can be null to indicate a new array is being worked on.
* @param typeString A String characterizing the type stored.
* @param isPrimitive Indicates whether the array is a wrapper type for a primitive array.
* @throws GUIException If a type is encountered that no array can be created for as it will not be supported by the GUI anyway.
*/
public ArrayModificationHandler(Object[] array, String typeString, boolean isPrimitive) throws GUIException {
this.array = array;
this.typeString = typeString;
this.isPrimitive = isPrimitive;
// Initialize the array if needed.
if (this.array == null) {
this.array = getNewArray();
} else {
// Build up the dimensions length.
ArrayList<Integer> dimensionsArrayList = new ArrayList<Integer>();
Object currentDimension = this.array;
while (currentDimension.getClass().isArray()) {
int length = ((Object[]) currentDimension).length;
dimensionsArrayList.add(Integer.valueOf(length));
if (length == 0) break;
currentDimension = ((Object[]) currentDimension)[0];
}
this.dimensionsLength = new int[dimensionsArrayList.size()];
Iterator<Integer> iterator = dimensionsArrayList.iterator();
int a = 0;
while (iterator.hasNext()) {
this.dimensionsLength[a] = iterator.next();
a++;
}
}
// At the beginning, we assume that there is a return value.
this.hasAReturnValue = true;
}
示例8: fireEvents
import java.util.ArrayList; //導入方法依賴的package包/類
public synchronized void fireEvents(SNESInputEvent e) {
if (brat != null) {
brat.fireSNESInputEvent(e);
return;
}
ArrayList<SNESControllable> firing = new ArrayList<SNESControllable>();
firing.addAll(children);
Iterator<SNESControllable> i = firing.iterator();
while (i.hasNext()) {
(i.next()).fireSNESInputEvent(e);
}
}
示例9: getDeletes
import java.util.ArrayList; //導入方法依賴的package包/類
@Override
@SuppressWarnings("unchecked")
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException {
final Type elementType = persister.getElementType();
final ArrayList deletes = new ArrayList();
final List sn = (List) getSnapshot();
final Iterator olditer = sn.iterator();
int i=0;
while ( olditer.hasNext() ) {
final Object old = olditer.next();
final Iterator newiter = bag.iterator();
boolean found = false;
if ( bag.size()>i && elementType.isSame( old, bag.get( i++ ) ) ) {
//a shortcut if its location didn't change!
found = true;
}
else {
//search for it
//note that this code is incorrect for other than one-to-many
while ( newiter.hasNext() ) {
if ( elementType.isSame( old, newiter.next() ) ) {
found = true;
break;
}
}
}
if ( !found ) {
deletes.add( old );
}
}
return deletes.iterator();
}
示例10: remove
import java.util.ArrayList; //導入方法依賴的package包/類
public void remove(String name){
ArrayList<Tag> list = getValue();
if(list == null) return;
Iterator it = list.iterator();
while(it.hasNext()){
Tag tag = (Tag) it.next();
if(tag.getName().equals(name)) {
it.remove();
setValue(list);
break;
}
}
}
示例11: getPublicIDs
import java.util.ArrayList; //導入方法依賴的package包/類
/**
* Get String iterator representing all public IDs registered in catalog.
* @return null if cannot proceed, try later.
*/
public java.util.Iterator getPublicIDs() {
ArrayList<String> ids = new ArrayList<String>();
ids.add(SAAS_SERVICES_1_0_ID);
return ids.iterator();
}
示例12: closeIndicatorOBVSettingPane
import java.util.ArrayList; //導入方法依賴的package包/類
/**
* Method to close OBV setting Pane for a OHLC
* @param category - OHLC category name
* @param market - OHLC market name
* @param code - OHLC code name
*/
public void closeIndicatorOBVSettingPane(String category, String market, String code){
String strTitle = "Indicator Setting";
if (leftBottomTabPane.hasTab(strTitle)){
//Remove it from the indicatorSettingMap;
String strKey = category + "-" + market + "-" + code;
Iterator<TitledPane> it = indicatorSettingPaneMap.get(strKey).iterator();
while(it.hasNext()){
TitledPane pane = it.next();
if (pane instanceof IndicatorOBVSettingPane){
indicatorSettingPaneMap.get(strKey).remove(pane);
//Removed it from the mainchart or volume chart
if (chartTabPane.getTab(strKey) != null){
Node node = chartTabPane.getTab(strKey);
if (node instanceof ChartCanvasPane){
ChartCanvasPane canvasPane = (ChartCanvasPane)node;
canvasPane.closeIndicatorChart(IndicatorType.OBV);
}
}
break;
}
}
//Removed it from the accordions
TatAccordion indicatorAccordion = new TatAccordion();
leftBottomTabPane.removeTab(strTitle);
if (indicatorSettingPaneMap.get(strKey).size() > 0){
leftBottomTabPane.addTab(strTitle, indicatorAccordion);
ArrayList<TitledPane> settings = indicatorSettingPaneMap.get(strKey);
Iterator<TitledPane> itAdd = settings.iterator();
while(itAdd.hasNext()){
indicatorAccordion.getPanes().addAll(itAdd.next());
}
indicatorAccordion.setExpandedPane(indicatorSettingPaneMap.get(strKey).get(indicatorSettingPaneMap.get(strKey).size() - 1));
}
}
}
示例13: applyModifiers
import java.util.ArrayList; //導入方法依賴的package包/類
private static HashMap<String, ArrayList<Element>> applyModifiers(Element classElement, ArrayList<String> modifiedBy, Map<String, Map<String, Element>> modifierClasses) {
HashMap<String, ArrayList<Element>> result = new HashMap<String, ArrayList<Element>>();
result.put(getCode(classElement), null);
Iterator<String> it = modifiedBy.iterator();
while (it.hasNext()) {
String modifier = it.next();
if (modifierClasses.containsKey(modifier)) {
result = modifierCartesianProduct(result, modifierClasses.get(modifier));
} else {
throw new IllegalArgumentException(ClamlConstants.MODIFIER_ATTR + " '" + modifier + "' unknown");
}
}
return result;
}
示例14: checkShortCutCollision
import java.util.ArrayList; //導入方法依賴的package包/類
/** check shortcuts in menu structure
* @param a
* @return
*/
private static StringBuffer checkShortCutCollision(ArrayList a) {
StringBuffer collisions = new StringBuffer("");
Iterator it = a.iterator();
HashMap check = new HashMap();
while (it.hasNext()) {
Object o = it.next();
if (o instanceof NbMenuItem) {
NbMenuItem item = (NbMenuItem) o;
if (item.getAccelerator() != null) {
//stream.println("checking : " + item.name + " - " + item.accelerator);
if (check.containsKey(item.getAccelerator())) {
collisions.append("\n !!!!!! Collision! accelerator ='" + item.getAccelerator() + "' : " + item.getName() + " is in collision with " + check.get(item.getAccelerator()));
} else {
check.put(item.getAccelerator(), item.getName());
}
}
}
if (o instanceof ArrayList) {
collisions.append(checkShortCutCollision((ArrayList) o));
}
}
return collisions;
}
示例15: getColorList
import java.util.ArrayList; //導入方法依賴的package包/類
public static List<Color> getColorList(String key, Bundle bundle, ArrayList<String> defaultValue) {
ArrayList<String> colors = CommonUtil.getValueStringList(key, getBundle(bundle), defaultValue);
ArrayList<Color> result = new ArrayList<Color>(colors.size());
Iterator<String> it = colors.iterator();
while (it.hasNext()) {
result.add(Color.fromString(it.next()));
}
return result;
}