本文整理汇总了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 ) );
}
示例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 ) );
}
示例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;
}
示例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;
}
示例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;
}
}
示例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
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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;
}
}