rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Calendar loc_calendar = (Calendar)calendar.clone(); loc_calendar.clear();
calendar.clear();
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); Calendar loc_calendar = (Calendar)calendar.clone(); loc_calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; for (; fmt_index < fmt_max; ++...
loc_calendar.setTimeZone (tz); loc_calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset ());
calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset ());
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); Calendar loc_calendar = (Calendar)calendar.clone(); loc_calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; for (; fmt_index < fmt_max; ++...
loc_calendar.set(calendar_field, value);
calendar.set(calendar_field, value);
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); Calendar loc_calendar = (Calendar)calendar.clone(); loc_calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; for (; fmt_index < fmt_max; ++...
int year = defaultCentury + loc_calendar.get(Calendar.YEAR); loc_calendar.set(Calendar.YEAR, year); if (loc_calendar.getTime().compareTo(defaultCenturyStart) < 0) loc_calendar.set(Calendar.YEAR, year + 100);
int year = defaultCentury + calendar.get(Calendar.YEAR); calendar.set(Calendar.YEAR, year); if (calendar.getTime().compareTo(defaultCenturyStart) < 0) calendar.set(Calendar.YEAR, year + 100);
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); Calendar loc_calendar = (Calendar)calendar.clone(); loc_calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; for (; fmt_index < fmt_max; ++...
loc_calendar.clear (Calendar.DST_OFFSET); loc_calendar.clear (Calendar.ZONE_OFFSET); } return loc_calendar.getTime();
calendar.clear (Calendar.DST_OFFSET); calendar.clear (Calendar.ZONE_OFFSET); } return calendar.getTime();
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); Calendar loc_calendar = (Calendar)calendar.clone(); loc_calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; for (; fmt_index < fmt_max; ++...
return new DirectByteBufferImpl
if (isReadOnly()) return new DirectByteBufferImpl.ReadOnly
public ByteBuffer slice() { int rem = remaining(); return new DirectByteBufferImpl (this, VMDirectByteBuffer.adjustAddress(address, position()), rem, rem, 0, isReadOnly()); }
rem, rem, 0, isReadOnly());
rem, rem, 0); else return new DirectByteBufferImpl.ReadWrite (this, VMDirectByteBuffer.adjustAddress(address, position()), rem, rem, 0);
public ByteBuffer slice() { int rem = remaining(); return new DirectByteBufferImpl (this, VMDirectByteBuffer.adjustAddress(address, position()), rem, rem, 0, isReadOnly()); }
public void setPixels(int x, int y, int w, int h, double[] dArray)
public void setPixels(int x, int y, int w, int h, int[] iArray)
public void setPixels(int x, int y, int w, int h, double[] dArray) { sampleModel.setPixels(x-sampleModelTranslateX, y-sampleModelTranslateY, w, h, dArray, dataBuffer); }
w, h, dArray, dataBuffer);
w, h, iArray, dataBuffer);
public void setPixels(int x, int y, int w, int h, double[] dArray) { sampleModel.setPixels(x-sampleModelTranslateX, y-sampleModelTranslateY, w, h, dArray, dataBuffer); }
protected Raster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, Raster parent)
protected Raster(SampleModel sampleModel, Point origin)
protected Raster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, Raster parent) { this.sampleModel = sampleModel; this.dataBuffer = dataBuffer; this.minX = aRegion.x; this.minY = aRegion.y; this.width = aRegion.width; this.height = aRegion.heig...
this.sampleModel = sampleModel; this.dataBuffer = dataBuffer; this.minX = aRegion.x; this.minY = aRegion.y; this.width = aRegion.width; this.height = aRegion.height; this.sampleModelTranslateX = sampleModelTranslate.x; this.sampleModelTranslateY = sampleModelTranslate.y; this.numBands = sampleModel.getNumBands(); this....
this(sampleModel, sampleModel.createDataBuffer(), origin);
protected Raster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, Raster parent) { this.sampleModel = sampleModel; this.dataBuffer = dataBuffer; this.minX = aRegion.x; this.minY = aRegion.y; this.width = aRegion.width; this.height = aRegion.heig...
return null;
private String evaluateCondition(String conf, DefaultDependencyDescriptor dd) { if (conf.charAt(0) != '[') { return conf; } int endConditionIndex = conf.indexOf(']'); if (endConditionIndex == -1) { addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId()); } String condition = ...
return ERDirectToWeb.d2wDebuggingEnabled(session()) || ERXUtilities.booleanValue(valueForBinding("condition"));
return ERDirectToWeb.d2wDebuggingEnabled(session()) || ERXValueUtilities.booleanValue(valueForBinding("condition"));
public boolean showHelp() { return ERDirectToWeb.d2wDebuggingEnabled(session()) || ERXUtilities.booleanValue(valueForBinding("condition")); }
if (Configuration.DEBUG) { String val = System.getProperty("gcj.dumpobjects"); if (val != null && !val.equals("")) dump = true; }
public ObjectOutputStream (OutputStream out) throws IOException { realOutput = new DataOutputStream(out); blockData = new byte[ BUFFER_SIZE ]; blockDataCount = 0; blockDataOutput = new DataOutputStream(this); setBlockDataMode(true); replacementEnabled = false; isSerializing = false; nextOID =...
currentObject = null; currentObjectStreamClass = null;
} this.currentObject = prevObject; this.currentObjectStreamClass = prevObjectStreamClass;
public final void writeObject(Object obj) throws IOException { if (useSubclassMethod) { writeObjectOverride(obj); return; } boolean was_serializing = isSerializing; boolean old_mode = setBlockDataMode(false); try { isSerializing = true; boolean replaceDone = false; Object replacedObject = ...
throw new StreamCorruptedException ("Exception " + ioe + " thrown while exception was being written to stream.");
StreamCorruptedException ex = new StreamCorruptedException (ioe + " thrown while exception was being written to stream."); if (Configuration.DEBUG) { ex.printStackTrace(System.out); } throw ex;
public final void writeObject(Object obj) throws IOException { if (useSubclassMethod) { writeObjectOverride(obj); return; } boolean was_serializing = isSerializing; boolean old_mode = setBlockDataMode(false); try { isSerializing = true; boolean replaceDone = false; Object replacedObject = ...
depth -= 2; if (dump) dumpElementln ("END: " + obj);
public final void writeObject(Object obj) throws IOException { if (useSubclassMethod) { writeObjectOverride(obj); return; } boolean was_serializing = isSerializing; boolean old_mode = setBlockDataMode(false); try { isSerializing = true; boolean replaceDone = false; Object replacedObject = ...
else if (name.equals("ureJava"))
else if (name.equals("PureJava"))
public static ReadlineLibrary byName(String name) { if (name.equals("GnuReadline")) return GnuReadline; else if (name.equals("Editline")) return Editline; else if (name.equals("ureJava")) return PureJava; return null; }
ManipManager.getManipManager().unregisterWindow(drawable); drawable.removeGLEventListener(this);
if (drawable != null) { ManipManager.getManipManager().unregisterWindow(drawable); drawable.removeGLEventListener(this); }
public void shutdownDemo() { ManipManager.getManipManager().unregisterWindow(drawable); drawable.removeGLEventListener(this); super.shutdownDemo(); }
public ConfigurationWriter getConfigurationWriter(NodeComponent[] nodes);
ConfigurationWriter getConfigurationWriter(NodeComponent[] nodes);
public ConfigurationWriter getConfigurationWriter(NodeComponent[] nodes);
public String getNodeFileAddition();
String getNodeFileAddition();
public String getNodeFileAddition();
System.out.println( method );
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { Throwable e = null; boolean invokedSuper = false; ...
throw new IllegalArgumentException("value may not be less then 0");
throw new IllegalArgumentException("value may not be less than 0");
public NumberOfDocuments(int value) { super(value); if (value < 0) throw new IllegalArgumentException("value may not be less then 0"); }
createLogger();
protected PropertyBase(ConfigurableComponent c) { component = c; createLogger(); }
if (listeners == null) listeners = new ArrayList();
if (listeners == null) listeners = new ArrayList(1);
public void addPropertyListener(PropertyListener l) { if (listeners == null) listeners = new ArrayList(); listeners.add(l); }
createLogger();
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); listeners = (List) stream.readObject(); createLogger(); }
organizer.addExperiment();
public void actionPerformed(ActionEvent e) { String s = ((AbstractButton)e.getSource()).getActionCommand(); if (s.equals(NEW_MENU_ITEM)) { newWorkspace(); } else if (s.equals(NEW_RESULTS_MENU_ITEM)) { setResultDir(); } else if (s.equals(EXIT_MENU_ITEM)) { exit(); } else if (s.equals(HELP...
if (line.charAt(0) != '#') { Agent newAg = processInputLine(line); if (newAg != null) { if (log.isApplicable(log.VERBOSE)) { log.log(this, log.VERBOSE, "parseParameters: " + this + " adding Agent to the world: " + newAg);
try { if (line.charAt(0) != '#') { Agent newAg = processInputLine(line); if (newAg != null) { if (log.isApplicable(log.VERBOSE)) { log.log(this, log.VERBOSE, "parseParameters: " + this + " adding Agent to the world: " + newAg); } world.addAgent(newAg);
private void parseParameters() { Vector pv = getParameters() != null ? new Vector(getParameters()) : null; if (pv == null) { throw new RuntimeException("TranducerPlugIn expects parameters, got none"); } String fileName = (String)pv.elementAt(0); if (fileName == null) { throw new RuntimeExcept...
world.addAgent(newAg);
} } catch(IndexOutOfBoundsException e) { if(line.length() == 0) { } else { System.err.println("Got an expection parsing input file.");
private void parseParameters() { Vector pv = getParameters() != null ? new Vector(getParameters()) : null; if (pv == null) { throw new RuntimeException("TranducerPlugIn expects parameters, got none"); } String fileName = (String)pv.elementAt(0); if (fileName == null) { throw new RuntimeExcept...
public ImpactModel getModel();
ImpactModel getModel();
public ImpactModel getModel();
public Iterator getImpact(Society world, IEFactory theIEF);
Iterator getImpact(Society world, IEFactory theIEF);
public Iterator getImpact(Society world, IEFactory theIEF);
public boolean isNodeType();
boolean isNodeType();
public boolean isNodeType();
addTool(EXPERIMENT_CONTROLLER, experiment.getExperimentName(), tool);
String s = ""; if (experiment != null) s = experiment.getExperimentName(); addTool(EXPERIMENT_CONTROLLER, s, tool);
protected void runConsole(Experiment experiment) { JFrame tool = (JFrame)new CSMARTConsole(this, experiment); addTool(EXPERIMENT_CONTROLLER, experiment.getExperimentName(), tool); }
* a race condition occured (two threads removing the same
* a race condition occurred (two threads removing the same
private void internalRemove(WeakBucket bucket) { int slot = bucket.slot; if (slot == -1) /* this bucket was already removed. */ return; /* mark the bucket as removed. This is necessary, since the * bucket may be enqueued later by the garbage collection and * internalRemove, will be called...
HashSet allowedTypes = new HashSet(); allowedTypes.add(new StringRange("Supporting")); allowedTypes.add(new StringRange("Subordinate")); propType.setAllowedValues(allowedTypes);
public void initProperties() { propType = addProperty(PROP_TYPE, relationship.getType()); propType.setToolTip(PROP_TYPE_DESC); propRole = addProperty(PROP_ROLE, relationship.getRole()); propRole.setToolTip(PROP_ROLE_DESC); propItem = addProperty(PROP_ITEM, relationship.getItem()); propItem.setToolTi...
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.viewer");
createLogger();
public OrganizerTree(DefaultTreeModel model) { super(model); this.model = model; setExpandsSelectedPaths(true); log = CSMART.createLogger("org.cougaar.tools.csmart.ui.viewer"); }
List components = getComponents();
BaseComponent theSoc = getSocietyComponent();
private boolean allowModifyCData() { // then give everyone a chance to modify what they've collectively produced boolean componentModified = false; List components = getComponents(); PopulateDb pdb = null; try { pdb = new PopulateDb(getExperimentID(), trialID); for (int i = 0, n = components....
for (int i = 0, n = components.size(); i < n; i++) { BaseComponent soc = (BaseComponent) components.get(i);
if (log.isDebugEnabled()) { log.debug("allowModify letting comps modify. comp: " + theSoc.getShortName()); } theSoc.modifyComponentData(completeSociety, pdb); componentModified |= theSoc.componentWasRemoved(); for (int i = 0, n = recipes.size(); i < n; i++) { BaseComponent soc = (BaseComponent) recipes.get(i);
private boolean allowModifyCData() { // then give everyone a chance to modify what they've collectively produced boolean componentModified = false; List components = getComponents(); PopulateDb pdb = null; try { pdb = new PopulateDb(getExperimentID(), trialID); for (int i = 0, n = components....
List components = getComponents();
private boolean askComponentsToAddCDATA() { List components = getComponents(); // Now ask each component in turn to add its stuff boolean componentWasRemoved = false; for (int i = 0, n = components.size(); i < n; i++) { BaseComponent soc = (BaseComponent) components.get(i); if(log.isDebugEnabled...
for (int i = 0, n = components.size(); i < n; i++) { BaseComponent soc = (BaseComponent) components.get(i);
BaseComponent theSoc = getSocietyComponent(); if(log.isDebugEnabled()) { log.debug(theSoc.getFullName().toString() + ".addComponentData"); } theSoc.addComponentData(completeSociety); componentWasRemoved |= theSoc.componentWasRemoved(); for (int i = 0, n = recipes.size(); i < n; i++) { BaseComponent soc = (BaseComponen...
private boolean askComponentsToAddCDATA() { List components = getComponents(); // Now ask each component in turn to add its stuff boolean componentWasRemoved = false; for (int i = 0, n = components.size(); i < n; i++) { BaseComponent soc = (BaseComponent) components.get(i); if(log.isDebugEnabled...
Method setter = type.getDeclaredMethod(methodName, new Class[]{ Callback[].class });
Method setter = getCallbacksSetter(type, methodName);
private static void setCallbacksHelper(Class type, Callback[] callbacks, String methodName) { // TODO: optimize try { Method setter = type.getDeclaredMethod(methodName, new Class[]{ Callback[].class }); setter.invoke(null, new Object[]{ callbacks }); } catch (NoSuchMethodE...
if (transforming) { if (filter != null && !(filter instanceof CallbackFilter2)) { throw new IllegalArgumentException("CallbackFilter2 must be used when transforming"); } } else if (classOnly ^ (callbacks == null)) { if (classOnly) { throw new IllegalStateException("createClass does not accept callbacks");
if (transforming && filter != null && !(filter instanceof CallbackFilter2)) { throw new IllegalArgumentException("CallbackFilter2 must be used when transforming"); } if ((classOnly || transforming) ^ (callbacks == null)) { if (classOnly || transforming) { throw new IllegalStateException("createClass and createTransform...
private void validate(boolean transforming) { if (transforming) { if (filter != null && !(filter instanceof CallbackFilter2)) { throw new IllegalArgumentException("CallbackFilter2 must be used when transforming"); } } else if (classOnly ^ (callbacks == null)) { ...
throw new IllegalStateException("callbacks are required unless using createClass");
throw new IllegalStateException("Callbacks are required");
private void validate(boolean transforming) { if (transforming) { if (filter != null && !(filter instanceof CallbackFilter2)) { throw new IllegalArgumentException("CallbackFilter2 must be used when transforming"); } } else if (classOnly ^ (callbacks == null)) { ...
if (callbacks == null && callbackTypes == null) { throw new IllegalStateException("Either callbacks or callback types are always required");
if ((classOnly || transforming) && callbackTypes == null) { throw new IllegalStateException("Callback types are required");
private void validate(boolean transforming) { if (transforming) { if (filter != null && !(filter instanceof CallbackFilter2)) { throw new IllegalArgumentException("CallbackFilter2 must be used when transforming"); } } else if (classOnly ^ (callbacks == null)) { ...
e.printStackTrace();
if(log.isErrorEnabled()) { log.error("Exception", e); }
public int addElement(Transferable transferable, DefaultMutableTreeNode target, DefaultMutableTreeNode before) { Object data = null; try { data = transferable.getTransferData(transferable.getTransferDataFlavors()[0]); } catch (Exception e) { e.printStackTrace(); return ...
protected String getBranch() {
public String getBranch() {
protected String getBranch() { return _branch; }
protected String getModule() {
public String getModule() {
protected String getModule() { return _module; }
protected String getOrganisation() {
public String getOrganisation() {
protected String getOrganisation() { return _organisation; }
protected String getProperty() {
public String getProperty() {
protected String getProperty() { return _property; }
protected String getRevision() {
public String getRevision() {
protected String getRevision() { return _revision; }
protected void setBranch(String branch) {
public void setBranch(String branch) {
protected void setBranch(String branch) { _branch = branch; }
protected void setModule(String module) {
public void setModule(String module) {
protected void setModule(String module) { _module = module; }
protected void setOrganisation(String organisation) {
public void setOrganisation(String organisation) {
protected void setOrganisation(String organisation) { _organisation = organisation; }
protected void setProperty(String prefix) {
public void setProperty(String prefix) {
protected void setProperty(String prefix) { _property = prefix; }
protected void setRevision(String revision) {
public void setRevision(String revision) {
protected void setRevision(String revision) { _revision = revision; }
if (s != null) data.add(s);
public static Vector getDataFromURL(String URLString) throws Exception { URL url = new URL(URLString); URLConnection connection = url.openConnection(); connection.setDoInput(true); connection.setDoOutput(true); InputStream is = connection.getInputStream(); BufferedReader r = new BufferedReader(...
HostComponent[] hosts = experiment.getHosts();
HostComponent[] hosts = experiment.getHostComponents();
private static void setHostToMonitor() { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARUL"); ArrayList potentialHosts = new ArrayList(); ArrayList potentialNodes = new ArrayList(); HostComponent[] hosts = experiment.getHosts(); for (int i = 0; i < hosts.length; i++) ...
for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents == null || agents.length == 0) continue; String thisHost = hosts[i].getShortName(); if (thisHost.equals(nameServerHost)) { newNameServer = oldNameServer; break hostLoop; } if (dfltNameServer == null) { dfltNameServer = ...
if (nodes.length == 0) continue; String thisHost = hosts[i].getShortName(); if (thisHost.equals(nameServerHost)) { newNameServer = oldNameServer; break hostLoop; } if (dfltNameServer == null) { dfltNameServer = thisHost + ":" + NAME_SERVER_PORTS; if (oldNameServer == null) { break hostLoop;
public void updateNameServerHostName() { Properties defaultNodeArgs = getDefaultNodeArguments(); String oldNameServer = defaultNodeArgs.getProperty("org.cougaar.name.server"); String newNameServer = null; String dfltNameServer = null; String nameServerHost = null; if (oldNameServer != null) { i...
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas = new GLCanvas();
private static void showFrame(String name, Point location) { Frame frame = new Frame(name); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.setLayout(new BorderLayout()); GLCanvas canvas = GLDrawableFacto...
if(ConfigFinder.getInstance().locateFile(assetFile) != null) {
if(SocietyFinder.getInstance().locateFile(assetFile) != null) {
protected void addAssetData() { String assetFile = filename.substring(0, filename.indexOf('.')); assetFile = assetFile + "-prototype-ini.dat"; // Check to see if the file exists before we do anything! if(ConfigFinder.getInstance().locateFile(assetFile) != null) { BaseComponent asset = (BaseCo...
if(log.isDebugEnabled()) { log.debug("Insertion Point: " + insertionPoint); }
protected void addBinders() { ContainerBase container = new ContainerBase("Binders"); container.initProperties(); addChild(container); ComponentDescription[] desc = ComponentConnector.parseFile(filename); if (desc == null) { if (log.isWarnEnabled()) { log.warn("No data found in file " + file...
if(log.isDebugEnabled()) { log.debug("Insertion Point: " + insertionPoint); }
protected void addComponents() { ContainerBase container = new ContainerBase("Other Components"); container.initProperties(); addChild(container); ComponentDescription[] desc = ComponentConnector.parseFile(filename); if (desc == null) { if (log.isWarnEnabled()) { log.warn("No data found in f...
if(log.isDebugEnabled()) { log.debug("Insertion Point: " + insertionPoint); }
protected void addPlugins() { ContainerBase container = new ContainerBase("Plugins"); container.initProperties(); addChild(container); ComponentDescription[] desc = ComponentConnector.parseFile(filename); if (desc == null) { if (log.isWarnEnabled()) { log.warn("No data found in file " + file...
RepositoryInterface.SearchRepository(document);
builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); document = builder.newDocument(); RepositoryInterface.SearchRepository(document); } catch (ParserConfigurationException e1) { e1.printStackTrace(); } catch (FactoryConfigurationError e1) { e1.printStackTrace();
private void makeActions() { action1 = new Action() { public void run() { try { RepositoryInterface.SearchRepository(document); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } showMessage("Document List refreshed"); } }; action1.setText("Refresh Document...
treeViewer.setInput(document);
private void makeActions() { action1 = new Action() { public void run() { try { RepositoryInterface.SearchRepository(document); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } showMessage("Document List refreshed"); } }; action1.setText("Refresh Document...
RepositoryInterface.SearchRepository(document);
builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); document = builder.newDocument(); RepositoryInterface.SearchRepository(document); } catch (ParserConfigurationException e1) { e1.printStackTrace(); } catch (FactoryConfigurationError e1) { e1.printStackTrace();
public void run() { try { RepositoryInterface.SearchRepository(document); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } showMessage("Document List refreshed"); }
treeViewer.setInput(document);
public void run() { try { RepositoryInterface.SearchRepository(document); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } showMessage("Document List refreshed"); }
Logger log = CSMART.createLogger("org.cougaar.tools.csmart.core.db.DBUtils"); Set s = new HashSet(); try { Connection conn = DBUtils.getConnection(); try { Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(dbQuery); while (rs.next()) {s.add(rs.getString(1));} rs.close(); stmt.close(); } finally ...
return dbGetPluginOrBinderClasses(dbQuery);
public static Set dbGetPluginClasses() { String dbQuery = DBUtils.getQuery(PLUGIN_QUERY, new HashMap()); Logger log = CSMART.createLogger("org.cougaar.tools.csmart.core.db.DBUtils"); Set s = new HashSet(); try { Connection conn = DBUtils.getConnection(); try { Statement stmt = conn.create...
byte [] image_number_array = int2ByteArray(image_number);
byte [] image_number_array = ArrayManipulator.int2ByteArray(image_number);
public static byte[] createDownloadDatagram(int file_index, int image_number) { //creation byte datagram[] = UDPDatagramHeader.createUDPDatagramHeader(file_index, Opcode.DOWNLOAD, 10); byte [] image_number_array = int2ByteArray(image_number); int i; int shift = UDPDatagramHeader.getHeaderSize(); //initialisation...
for(i=0; i<4; i++) datagram[i+shift] = image_number_array[i];
ArrayManipulator.copyArrayAtEnd(datagram, image_number_array, shift);
public static byte[] createDownloadDatagram(int file_index, int image_number) { //creation byte datagram[] = UDPDatagramHeader.createUDPDatagramHeader(file_index, Opcode.DOWNLOAD, 10); byte [] image_number_array = int2ByteArray(image_number); int i; int shift = UDPDatagramHeader.getHeaderSize(); //initialisation...
byte image_number[] = { datagram[UDPDatagramHeader.getHeaderSize()], datagram[UDPDatagramHeader.getHeaderSize()+1], datagram[UDPDatagramHeader.getHeaderSize()+2], datagram[UDPDatagramHeader.getHeaderSize()+3] }; return byteArray2Int(image_number);
int size = UDPDatagramHeader.getHeaderSize(); byte image_number[] = { datagram[size], datagram[size+1], datagram[size+2], datagram[size+3] }; return ArrayManipulator.byteArray2Int(image_number);
public static int getImageNumber(byte [] datagram) { byte image_number[] = { datagram[UDPDatagramHeader.getHeaderSize()], datagram[UDPDatagramHeader.getHeaderSize()+1], datagram[UDPDatagramHeader.getHeaderSize()+2], datagram[UDPDatagramHeader.getHeaderSize()+3] }; return byteArray2Int(image_number); ...
super.mergeSort((Comparable[])a[index], 0, ((Comparable[])a[index]).length);
super.mergeSort((Object[])a[index], 0, ((Object[])a[index]).length - 1);
public void mergeSort(int index) { super.mergeSort((Comparable[])a[index], 0, ((Comparable[])a[index]).length); }
super.quickSort((Comparable[])a[index], 0, ((Comparable[])a[index]).length);;
super.quickSort((Object[])a[index], 0, ((Object[])a[index]).length - 1);
public void quickSort(int index) { super.quickSort((Comparable[])a[index], 0, ((Comparable[])a[index]).length);; }
append(new IALOAD());
append(new BALOAD());
protected void array_load(Class clazz) { if (clazz.isPrimitive()) { if (clazz.equals(Long.TYPE)) { append(new LALOAD()); } else if (clazz.equals(Double.TYPE)) { append(new DALOAD()); } else if (clazz.equals(Float.TYPE)) { append(ne...
append(new IASTORE());
append(new BASTORE());
protected void array_store(Class clazz) { if (clazz.isPrimitive()) { if (clazz.equals(Long.TYPE)) { append(new LASTORE()); } else if (clazz.equals(Double.TYPE)) { append(new DASTORE()); } else if (clazz.equals(Float.TYPE)) { append...
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console");
createLogger();
public ConsoleTextPane(ConsoleStyledDocument doc, NodeStatusButton statusButton) { super(doc); log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console"); this.doc = doc; this.statusButton = statusButton; highlighter = getHighlighter(); searchHighlight = new Defa...
public void load(String filename) throws IOException;
void load(String filename) throws IOException;
public void load(String filename) throws IOException;
public void parse() throws IOException;
void parse() throws IOException;
public void parse() throws IOException;
public void setCommentChar(String chr);
void setCommentChar(String chr);
public void setCommentChar(String chr);
public void setSeparatorChar(String chr);
void setSeparatorChar(String chr);
public void setSeparatorChar(String chr);
rData.setType((String)rel.getProperty(PROP_TYPE).getValue());
rData.setType((String)rel.getProperty(RelationshipBase.PROP_TYPE).getValue());
public ComponentData addComponentData(ComponentData data) { AgentAssetData assetData = new AgentAssetData((AgentComponentData)data); assetData.setType(((Integer)propAssetType.getValue()).intValue()); assetData.setAssetClass((String)propAssetClass.getValue()); assetData.setUniqueID((String)propUniqueID.get...
rData.setSupported((String)rel.getProperty(RelationshipBase.PROP_SUPPORTED).getValue());
public ComponentData addComponentData(ComponentData data) { AgentAssetData assetData = new AgentAssetData((AgentComponentData)data); assetData.setType(((Integer)propAssetType.getValue()).intValue()); assetData.setAssetClass((String)propAssetClass.getValue()); assetData.setUniqueID((String)propUniqueID.get...
} else if (e.getPreviousValue() == null) { fireModification();
public void propertyValueChanged(PropertyEvent e) { if (e == null || e.getProperty() == null) return; if (e.getProperty().getValue() == null) { if (e.getPreviousValue() == null) return; else fireModification(); } else if (! e.getProperty().getValue().toString().trim().equals(e.getPreviousValue().toS...
if (peer != null) ((MenuPeer) peer).addSeparator();
add(new MenuItem(separatorLabel));
addSeparator(){ if (peer != null) ((MenuPeer) peer).addSeparator();}
insert(separator, index);
insert(new MenuItem(separatorLabel), index);
insertSeparator(int index){ insert(separator, index);}
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.plan");
createLogger();
public ULPlanNode(PropertyTree p, String communityName) { log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.plan"); this.properties = p; UID = (String)properties.get(PropertyNames.UID_ATTR); tooltip = UID; // default tooltip if none other is set objectType = (String)properties.get(Property...
java.util.Enumeration e = items.elements();
Enumeration e = items.elements();
addNotify(){ if (peer == null) peer = getToolkit().createMenu(this); java.util.Enumeration e = items.elements(); while (e.hasMoreElements()) { MenuItem mi = (MenuItem)e.nextElement(); mi.addNotify(); } super.addNotify ();}
Enumeration e = items.elements(); while (e.hasMoreElements()) { MenuItem mi = (MenuItem) e.nextElement(); mi.removeNotify(); }
removeNotify(){ super.removeNotify();}
public static boolean arrayEquals(Object[] a1, Object[] a2) {
public static boolean arrayEquals(Object[] a1, Object[] a2, Transformer t) {
public static boolean arrayEquals(Object[] a1, Object[] a2) { if ((a1 == null) ^ (a2 == null)) { return false; } if (a1.length != a2.length) { return false; } for (int i = 0; i < a1.length; i++) { Object o1 = a1[i]; Object o2 = a2[i]; ...
Class c1 = o1.getClass(); Class c2 = o2.getClass(); if (!c1.equals(c2)) {
if (!t.transform(o1).equals(t.transform(o2))) {
public static boolean arrayEquals(Object[] a1, Object[] a2) { if ((a1 == null) ^ (a2 == null)) { return false; } if (a1.length != a2.length) { return false; } for (int i = 0; i < a1.length; i++) { Object o1 = a1[i]; Object o2 = a2[i]; ...
setNamePrefix(BeanMap.class.getName()); return (BeanMap)super.create(beanClass);
setNamePrefix(beanClass.getName()); return (BeanMap)super.create(beanClass.getName());
public BeanMap create() { setNamePrefix(BeanMap.class.getName()); return (BeanMap)super.create(beanClass); }
return bean.getClass().getClassLoader();
return beanClass.getClassLoader();
protected ClassLoader getDefaultClassLoader() { return bean.getClass().getClassLoader(); }
if (show == null && showElement != null) { element.remove(showElement);
if (show == null) { if (showElement != null) { element.remove(showElement); }
public void setShow(Show show) { Element showElement = element.element("show"); // If show is null, clear the subject. if (show == null && showElement != null) { element.remove(showElement); return; } if (showElement == null) { if (!isAvailable()) ...
if (status == null && statusElement != null) { element.remove(statusElement);
if (status == null) { if (statusElement != null) { element.remove(statusElement); }
public void setStatus(String status) { Element statusElement = element.element("status"); // If subject is null, clear the subject. if (status == null && statusElement != null) { element.remove(statusElement); return; } if (statusElement == null) { ...
+"&launch=" + IliasNextScoId
+"&launch=" + IliasNextObjId
private final void IliasFinish (boolean commit) { if (!isLaunched) return; if (commit) IliasCommit(); // Stupid "implicit commit" isLaunched = false; IliasLaunchContent ( "../scorm_presentation.php?cmd=finishSco" +"&sco_id=" + IliasScoId +"&ref_id=" + IliasRefId +"&status=" + core.sysGet("cmi.core...
say ("Overclicked.");
say ("Click ignored.");
public final void IliasLaunchSco (String sco_id) { if (System.currentTimeMillis() < clickTime + 1000) { say ("Overclicked."); return; } if (isLaunching) { say ("SCO " +IliasScoId +" is launching."); return; } if (isLaunched && sco_id.equals(IliasScoId)) { say ("SCO " +sco_id +" is already running."); ...
clickTime = System.currentTimeMillis();
public final void IliasLaunchSco (String sco_id) { if (System.currentTimeMillis() < clickTime + 1000) { say ("Overclicked."); return; } if (isLaunching) { say ("SCO " +IliasScoId +" is launching."); return; } if (isLaunched && sco_id.equals(IliasScoId)) { say ("SCO " +sco_id +" is already running."); ...
IliasNextScoId = sco_id;
IliasNextObjId = sco_id;
public final void IliasLaunchSco (String sco_id) { if (System.currentTimeMillis() < clickTime + 1000) { say ("Overclicked."); return; } if (isLaunching) { say ("SCO " +IliasScoId +" is launching."); return; } if (isLaunched && sco_id.equals(IliasScoId)) { say ("SCO " +sco_id +" is already running."); ...
IliasNextScoId = null;
IliasNextObjId = null;
public final void IliasLaunchSco (String sco_id) { if (System.currentTimeMillis() < clickTime + 1000) { say ("Overclicked."); return; } if (isLaunching) { say ("SCO " +IliasScoId +" is launching."); return; } if (isLaunched && sco_id.equals(IliasScoId)) { say ("SCO " +sco_id +" is already running."); ...
return lf.createLogger(name);
synchronized (_loggers) { Logger l = (Logger)_loggers.get(name); if (l == null) { l = lf.createLogger(name); _loggers.put(name, l); } return l; }
public static Logger createLogger(String name) { return lf.createLogger(name); }