當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector.removeElement方法代碼示例

本文整理匯總了Java中java.util.Vector.removeElement方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector.removeElement方法的具體用法?Java Vector.removeElement怎麽用?Java Vector.removeElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Vector的用法示例。


在下文中一共展示了Vector.removeElement方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: assertMatchingSet

import java.util.Vector; //導入方法依賴的package包/類
protected void assertMatchingSet( String comment, Object[] expected, Object[] found ) {
    Vector expectedItems = new Vector();
    Vector foundItems    = new Vector();

    for (int i = 0; i < expected.length; i++) expectedItems.addElement( expected[i] );
    for (int i = 0; i < found.length; i++) foundItems.addElement( found[i] );

    for (int i = 0; i < expected.length; i++) {
        if (!foundItems.contains( expected[i] )) {
            fail( comment + ": expected " + asText( expected ) + " but found " + asText( found ) );
        } else {
            foundItems.removeElement( expected[i] );
        }
    }

    for (int i = 0; i < found.length; i++) {
        if (!expectedItems.contains( found[i] )) {
            fail( comment + ": expected " + asText( expected ) + " but found " + asText( found ) );
        } else {
            expectedItems.removeElement( found[i] );
        }
    }

    if (!foundItems.isEmpty()) fail( comment + ": expected " + asText( expected ) + " but found " + asText( found ) );
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:26,代碼來源:ServletUnitTest.java

示例2: assertMatchingSet

import java.util.Vector; //導入方法依賴的package包/類
public static void assertMatchingSet( String comment, Object[] expected, Object[] found ) {
    Vector foundItems = new Vector();
    for (int i = 0; i < found.length; i++) foundItems.addElement( found[ i ] );

    Vector expectedItems = new Vector();

    for (int i = 0; i < expected.length; i++) expectedItems.addElement( expected[ i ] );

    for (int i = 0; i < expected.length; i++) {
        if (!foundItems.contains( expected[ i ] )) {
            fail( comment + ": expected " + asText( expected ) + " but found " + asText( found ) );
        } else {
            foundItems.removeElement( expected[ i ] );
        }
    }

    for (int i = 0; i < found.length; i++) {
        if (!expectedItems.contains( found[ i ] )) {
            fail( comment + ": expected " + asText( expected ) + " but found " + asText( found ) );
        } else {
            expectedItems.removeElement( found[ i ] );
        }
    }

    if (!foundItems.isEmpty()) fail( comment + ": expected " + asText( expected ) + " but found " + asText( found ) );
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:27,代碼來源:HttpUserAgentTest.java

示例3: removeAuxiliaryLookAndFeel

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:39,代碼來源:UIManager.java

示例4: removeAuxiliaryLookAndFeel

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 *
 * @param laf the {@code LookAndFeel} to be removed
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:41,代碼來源:UIManager.java

示例5: removeRelationSetListener

import java.util.Vector; //導入方法依賴的package包/類
public synchronized void removeRelationSetListener(RelationSetListener l) {
  if(listeners != null && listeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<RelationSetListener> v =
            (Vector<RelationSetListener>)listeners.clone();
    v.removeElement(l);
    listeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:RelationSet.java

示例6: removeCreoleListener

import java.util.Vector; //導入方法依賴的package包/類
public synchronized void removeCreoleListener(CreoleListener l) {
  if(creoleListeners != null && creoleListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<CreoleListener> v =
            (Vector<CreoleListener>)creoleListeners.clone();
    v.removeElement(l);
    creoleListeners = v;
  }// if
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:Factory.java

示例7: removeDatastoreListener

import java.util.Vector; //導入方法依賴的package包/類
@Override
public synchronized void removeDatastoreListener(DatastoreListener l) {
  if (datastoreListeners != null && datastoreListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<DatastoreListener> v = (Vector<DatastoreListener>) datastoreListeners.clone();
    v.removeElement(l);
    datastoreListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:SerialDataStore.java

示例8: removeStatusListener

import java.util.Vector; //導入方法依賴的package包/類
public synchronized void removeStatusListener(StatusListener l) {
  if (statusListeners != null && statusListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<StatusListener> v = (Vector<StatusListener>) statusListeners.clone();
    v.removeElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:9,代碼來源:SerialControllerEditor.java

示例9: removeAnnotationSetListener

import java.util.Vector; //導入方法依賴的package包/類
@Override
public synchronized void removeAnnotationSetListener(AnnotationSetListener l) {
  if(annotationSetListeners != null && annotationSetListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<AnnotationSetListener> v = (Vector<AnnotationSetListener>)annotationSetListeners.clone();
    v.removeElement(l);
    annotationSetListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:AnnotationSetImpl.java

示例10: getRHSFirstSet

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Function that computes the first set of the right hand side of the current
 * grammar rule.
 *
 * @param poEpsilon what to consider a termination element
 * @return a collection of the elements in the first set
 */
public Vector getRHSFirstSet(final GrammarElement poEpsilon) {
    Vector oFirstSet = new Vector();

    boolean bAllEpsilon = true;

    //GrammarElement rhsElemOfProduction = null;

    for (int j = 0; j < oRHS.size() && bAllEpsilon; j++) {
        // Add the first set of each rhs elem to the set (as long as all the
        // previous ones contained epsilon).
        GrammarElement oProdElement = (GrammarElement) oRHS.elementAt(j);

        // Skip semantic tokens here
        if (oProdElement.isNonTerminal() == false && oProdElement.isTerminal() == false) {
            continue;
        }

        Vector oNextFirstSet = (Vector) oProdElement.getFirstSet().clone();

        for (int f = 0; f < oNextFirstSet.size(); f++) {
            Terminal oTerminal = (Terminal) oNextFirstSet.elementAt(f);
            oFirstSet.addElement(oTerminal);
        }

        if (oFirstSet.contains(poEpsilon)) {
            oFirstSet.removeElement(poEpsilon);
        } else {
            bAllEpsilon = false;
        }
    }

    // If a first set of every element of a RHS production
    // had epsilon in it, we add it to the FirstSet as well
    if (bAllEpsilon) {
        oFirstSet.addElement(poEpsilon);
    }

    return oFirstSet;
}
 
開發者ID:souhaib100,項目名稱:MARF-for-Android,代碼行數:47,代碼來源:Rule.java

示例11: removeCreoleListener

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Removes a previously registered {@link gate.event.CreoleListener} from the
 * list of listeners for this DataStoreRegister. Normally the only listener
 * that is registered with the DataStoreRegister is the {@link CreoleRegister}
 * which can be obtained through {@link Gate#getCreoleRegister()}
 */
public synchronized void removeCreoleListener(CreoleListener l) {
  if (creoleListeners != null && creoleListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<CreoleListener> v = (Vector<CreoleListener>) creoleListeners.clone();
    v.removeElement(l);
    creoleListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:15,代碼來源:DataStoreRegister.java

示例12: removeCorpusListener

import java.util.Vector; //導入方法依賴的package包/類
@Override
public synchronized void removeCorpusListener(CorpusListener l) {
  if(corpusListeners != null && corpusListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<CorpusListener> v = (Vector<CorpusListener>)corpusListeners.clone();
    v.removeElement(l);
    corpusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:CorpusImpl.java

示例13: execute

import java.util.Vector; //導入方法依賴的package包/類
@Override
public void execute(String commandName, ConsoleInput console, List<String> args) {
	startNow = false;
	Vector newargs = new Vector(args);
	if (!newargs.isEmpty() && newargs.contains("now") ) {
		newargs.removeElement("now");
		startNow = true;
	}
	super.execute(commandName, console, args);
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:11,代碼來源:TorrentStart.java

示例14: execute

import java.util.Vector; //導入方法依賴的package包/類
@Override
public void execute(String commandName, ConsoleInput ci, List<String> args) {
	mode = MODE_ON;
	Vector newargs = new Vector(args);
	if (newargs.isEmpty()) {
		mode = MODE_FLIP;
	} else if (newargs.contains("off")) {
		newargs.removeElement("off");
		mode = MODE_OFF;
	} else if (!newargs.contains("on")) {
		mode = MODE_FLIP;
	}
	super.execute(commandName, ci, args);
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:15,代碼來源:TorrentLog.java

示例15: removeProgressListener

import java.util.Vector; //導入方法依賴的package包/類
/**
 * Removes a {@link gate.event.ProgressListener} from the list of listeners
 * for this processing resource.
 */
public synchronized void removeProgressListener(ProgressListener l) {
  if (progressListeners != null && progressListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<ProgressListener> v = (Vector<ProgressListener>)progressListeners.clone();
    v.removeElement(l);
    progressListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:13,代碼來源:AbstractProcessingResource.java


注:本文中的java.util.Vector.removeElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。