public static Evaluator getEvaluator(java.lang.Integer type, string oper) { Evaluator evaluator = null; if (oper.Equals("==")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.EQUAL)); } else if (oper.Equals("!=")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.NOT_EQUAL)); } else if (oper.Equals("<")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.LESS)); } else if (oper.Equals("<=")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.LESS_OR_EQUAL)); } else if (oper.Equals(">")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.GREATER)); } else if (oper.Equals(">=")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.GREATER_OR_EQUAL)); } else if (oper.Equals("contains")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.CONTAINS)); } else if (oper.Equals("matches")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.MATCHES)); } else if (oper.Equals("excludes")) { evaluator = getEvaluator(type, new Integer(Evaluator.__Fields.EXCLUDES)); } else { throw new IllegalArgumentException("Unknown oper: '" + oper + "'"); } return(evaluator); }
public WaferMapRenderer(Integer paintLimit, Integer paintIndexMethod) { WaferMapRenderer waferMapRenderer = this; this.paintIndex = (Map) new HashMap(); this.paintLimit = paintLimit != null ? paintLimit.intValue() : 35; this.paintIndexMethod = 1; if (paintIndexMethod == null || !this.isMethodValid(paintIndexMethod.intValue())) return; this.paintIndexMethod = paintIndexMethod.intValue(); }
public void TestMethod() { AbstractClass abc = null; Class clazz = java.lang.Object.instancehelper_getClass(this); string testName = abc.Name; abc.Name = testName; Integer a = new Integer(0); int i = a.intValue(); AbstractClass.InnerAbstractClass inf = new AnonymousClassAbstractClass_InnerAbstractClass1(i, this); Integer[] b = null; bool ab = (a == null) || (b == null); int j = 0; assertEquals("message :", i, j); }
public static List <T> getElementsFromArray <T>(this Object array) where T : Object { if (array.getClass().isArray().isFalse()) { "[getElementsFromArray] provided object is not an java array".error(); return(null); } var getArray = "java.lang.reflect.Array".java_Class() .getMethods() .Where((method) => method.getName() == "get").first(); var arrayValues = new List <T>(); for (int i = 0; i < (int)JNIEnv.ThreadEnv.invoke("GetArrayLength", array); i++) { var index = new java.lang.Integer(i); var value = (T)getArray.invoke(null, new java.lang.Object[] { array, index }); arrayValues.Add(value); } return(arrayValues); }
public static void set(object arrayObj, int index, object value) { if (arrayObj == null) { throw new java.lang.NullPointerException(); } Type type = arrayObj.GetType(); if (ReflectUtil.IsVector(type) && ClassLoaderWrapper.GetWrapperFromType(type.GetElementType()).IsPrimitive) { java.lang.Boolean booleanValue = value as java.lang.Boolean; if (booleanValue != null) { setBoolean(arrayObj, index, booleanValue.booleanValue()); return; } java.lang.Byte byteValue = value as java.lang.Byte; if (byteValue != null) { setByte(arrayObj, index, byteValue.byteValue()); return; } java.lang.Character charValue = value as java.lang.Character; if (charValue != null) { setChar(arrayObj, index, charValue.charValue()); return; } java.lang.Short shortValue = value as java.lang.Short; if (shortValue != null) { setShort(arrayObj, index, shortValue.shortValue()); return; } java.lang.Integer intValue = value as java.lang.Integer; if (intValue != null) { setInt(arrayObj, index, intValue.intValue()); return; } java.lang.Float floatValue = value as java.lang.Float; if (floatValue != null) { setFloat(arrayObj, index, floatValue.floatValue()); return; } java.lang.Long longValue = value as java.lang.Long; if (longValue != null) { setLong(arrayObj, index, longValue.longValue()); return; } java.lang.Double doubleValue = value as java.lang.Double; if (doubleValue != null) { setDouble(arrayObj, index, doubleValue.doubleValue()); return; } } try { CheckArray(arrayObj).SetValue(value, index); } catch (InvalidCastException) { throw new java.lang.IllegalArgumentException("argument type mismatch"); } catch (IndexOutOfRangeException) { throw new java.lang.ArrayIndexOutOfBoundsException(); } }
public void integerArray() { Integer[] objects = new Integer[3]; objects[0] = 6857; Integer[] res = testInstance.integerArray(objects); int i = (int)res[1]; Assert.IsTrue(i.Equals(6857)); }
//***************************************** Create Object Factory *******************************************// //The Object Factory, Used to create the elements of the score as required //***************************************** ScorePartwise *******************************************// // Create the top level Partwise Score Element public static ScorePartwise CreateScorePartwise(ScoreProperties i) { ObjectFactory factory = new ObjectFactory(); //Create a scorepart ScorePartwise.Part part; Marshalling.getContext(); ///////////////////// Following are the main components required for the Score in Phase 1 //***************************************** ScorePartwise *******************************************// ScorePartwise scorePartwise = factory.createScorePartwise(); // Set the version of MusicXML scorePartwise.setVersion("3.0"); //***************************************** Set Work and Movement Titles *******************************************// // Create the work element and set its title Work work = factory.createWork(); work.setWorkTitle(i.WorkTitle); //Setting some properties of the root element. scorePartwise.setMovementTitle(i.MovementTitle); //Set the work title of the scorepartwise scorePartwise.setWork(work); //***************************************** Create and set Identification Element *******************************************// //Create identification and set its properties Identification identification = factory.createIdentification(); com.audiveris.proxymusic.Encoding encoding = factory.createEncoding(); //set the software used for encoding encoding.getEncodingDateOrEncoderOrSoftware().add(factory.createEncodingSoftware(i.EncodingSoftware)); // set the encoding identification.setEncoding(encoding); scorePartwise.setIdentification(identification); //***************************************** Set the Credit words *******************************************// Credit credit = factory.createCredit(); FormattedText creditwordtext = new FormattedText(); creditwordtext.setValue(i.CreditWords); credit.getCreditTypeOrLinkOrBookmark().add(creditwordtext); scorePartwise.getCredit().add(credit); //***************************************** Create a PartList *******************************************// PartList partlist = factory.createPartList(); // create a scorepart ScorePart scorepart = factory.createScorePart(); ////////////////////////Some Properties of the scorepart PartName partname = factory.createPartName(); partname.setValue(i.PartDisplayName); scorepart.setPartName(partname); //set part abbreviation partname.setValue(i.PartAbbreviation); scorepart.setPartAbbreviation(partname); //set the scorepart id scorepart.setId(i.ScorePartID); // set the scorepart instrument ScoreInstrument scoreinstrument = factory.createScoreInstrument(); scoreinstrument.setId(i.InstrumentID); scoreinstrument.setInstrumentName(i.InstrumentName); scorepart.getScoreInstrument().add(scoreinstrument); //set the midi device parameters MidiInstrument midiinstrument = factory.createMidiInstrument(); //set midi instrument Id midiinstrument.setId(scoreinstrument); //set midi channel java.lang.Integer midichannel = i.MidiChannel; //channel number midiinstrument.setMidiChannel(midichannel); //set midi program java.lang.Integer midiprogram = i.MidiProgram; //program number midiinstrument.setMidiProgram(midiprogram); scorepart.getMidiDeviceAndMidiInstrument().add(midiinstrument); // add the scorepart to the partlist partlist.getPartGroupOrScorePart().add(scorepart); //Ambiguity scorePartwise.setPartList(partlist); //***************************************** Create a Part *******************************************// if (i.Part == null) { part = factory.createScorePartwisePart(); } else { part = i.Part; } //set part id part.setId(scorepart); // Add the part to the score scorePartwise.getPart().add(part); return(scorePartwise); }
private void assertIntegerValue(AttributeValue attr, int value) { Assert.IsInstanceOfType(attr.getValue(), typeof(PrimitiveObjectBlock)); PrimitiveObjectBlock pob = (PrimitiveObjectBlock)attr.getValue(); Assert.IsInstanceOfType(pob.getSimpleValue(), typeof(IntegerValue)); IntegerValue actual = (IntegerValue)pob.getSimpleValue(); Integer expected = new Integer(value); Assert.AreEqual(actual.getValue(), expected); }
private void refreshYearSelector() { if (this.refreshing) return; this.refreshing = true; this.yearSelector.removeAllItems(); foreach (object obj in this.getYears(this.chosenDate.get(1))) this.yearSelector.addItem(obj); JComboBox jcomboBox = this.yearSelector; Integer.__\u003Cclinit\u003E(); Integer integer = new Integer(this.chosenDate.get(1)); jcomboBox.setSelectedItem((object) integer); this.refreshing = false; }
// $ANTLR end "multExpr" // $ANTLR start "atom" // JavaCompat\\Expr.g3:96:0: atom returns [int value] : ( INT | ID | '(' expr ')' ); private int atom( ) { int value = default(int); IToken INT4 = null; IToken ID5 = null; int expr6 = default(int); try { // JavaCompat\\Expr.g3:97:9: ( INT | ID | '(' expr ')' ) int alt5 = 3; switch (input.LA(1)) { case INT: { alt5 = 1; } break; case ID: { alt5 = 2; } break; case 9: { alt5 = 3; } break; default: { NoViableAltException nvae = new NoViableAltException("", 5, 0, input); throw nvae; } } switch (alt5) { case 1: // JavaCompat\\Expr.g3:97:9: INT { INT4 = (IToken)Match(input, INT, Follow._INT_in_atom231); value = Integer.parseInt((INT4 != null?INT4.Text:null)); } break; case 2: // JavaCompat\\Expr.g3:98:9: ID { ID5 = (IToken)Match(input, ID, Follow._ID_in_atom243); Integer v = (Integer)memory.get((ID5 != null?ID5.Text:null)); if (v != null) { value = v.intValue(); } else { JSystem.err.println("undefined variable " + (ID5 != null?ID5.Text:null)); } } break; case 3: // JavaCompat\\Expr.g3:104:9: '(' expr ')' { Match(input, 9, Follow._9_in_atom263); PushFollow(Follow._expr_in_atom265); expr6 = expr(); state._fsp--; Match(input, 10, Follow._10_in_atom267); value = expr6; } break; } } catch (RecognitionException re) { ReportError(re); Recover(input, re); } finally { } return(value); }
public SettingsImplementation(ProjectiveDevice.Settings settings) : base(settings) { CameraDevice.SettingsImplementation settingsImplementation1 = this; this.deviceNumber = (Integer) null; this.deviceFile = (File) null; this.devicePath = (string) null; this.frameGrabber = (Class) null; this.format = ""; this.imageWidth = 0; this.imageHeight = 0; this.frameRate = 0.0; this.triggerMode = false; this.triggerFlushSize = 5; this.bpp = 0; this.colorMode = FrameGrabber.ColorMode.__\u003C\u003ERAW; this.timeout = 10000; this.numBuffers = 4; this.deinterlace = false; if (!(settings is CameraDevice.SettingsImplementation)) return; CameraDevice.SettingsImplementation settingsImplementation2 = (CameraDevice.SettingsImplementation) settings; this.deviceNumber = settingsImplementation2.deviceNumber; this.deviceFile = settingsImplementation2.deviceFile; this.devicePath = settingsImplementation2.devicePath; this.frameGrabber = settingsImplementation2.frameGrabber; this.format = settingsImplementation2.format; this.imageWidth = settingsImplementation2.imageWidth; this.imageHeight = settingsImplementation2.imageHeight; this.frameRate = settingsImplementation2.frameRate; this.triggerMode = settingsImplementation2.triggerMode; this.triggerFlushSize = settingsImplementation2.triggerFlushSize; this.bpp = settingsImplementation2.bpp; this.colorMode = settingsImplementation2.colorMode; this.timeout = settingsImplementation2.timeout; this.numBuffers = settingsImplementation2.numBuffers; this.deinterlace = settingsImplementation2.deinterlace; }
public SettingsImplementation() { CameraDevice.SettingsImplementation settingsImplementation = this; this.deviceNumber = (Integer) null; this.deviceFile = (File) null; this.devicePath = (string) null; this.frameGrabber = (Class) null; this.format = ""; this.imageWidth = 0; this.imageHeight = 0; this.frameRate = 0.0; this.triggerMode = false; this.triggerFlushSize = 5; this.bpp = 0; this.colorMode = FrameGrabber.ColorMode.__\u003C\u003ERAW; this.timeout = 10000; this.numBuffers = 4; this.deinterlace = false; this.name = "Camera 0"; }
private void refreshYearSelector() { if (this.refreshing) return; this.refreshing = true; this.yearSelector.removeAllItems(); Enumeration enumeration = this.getYears(this.date.getYYYY()).elements(); while (enumeration.hasMoreElements()) this.yearSelector.addItem(enumeration.nextElement()); JComboBox jcomboBox = this.yearSelector; Integer.__\u003Cclinit\u003E(); Integer integer = new Integer(this.date.getYYYY()); jcomboBox.setSelectedItem((object) integer); this.refreshing = false; }
private void makePaintIndex() { if (this.plot == null) return; WaferMapDataset dataset = this.plot.getDataset(); Number minValue = dataset.getMinValue(); Number maxValue = dataset.getMaxValue(); Set uniqueValues = dataset.getUniqueValues(); if (uniqueValues.size() <= this.paintLimit) { int num1 = 0; Iterator iterator = uniqueValues.iterator(); while (iterator.hasNext()) { Map map = this.paintIndex; object obj = iterator.next(); int num2 = num1; ++num1; Integer integer = new Integer(num2); map.put(obj, (object) integer); } } else { int num1 = this.paintIndexMethod; int num2 = 0; if (num1 == num2) { this.makePositionIndex(uniqueValues); } else { int num3 = 1; if (num1 != num3) return; this.makeValueIndex(maxValue, minValue, uniqueValues); } } }
public static FieldValue getFieldValue(string value, java.lang.Integer valueTypeObj) { int valueType = valueTypeObj.intValue(); FieldValue field = null; if (value == null) { valueType = Evaluator.__Fields.NULL_TYPE; } switch (valueType) { case Evaluator.__Fields.NULL_TYPE: field = new FieldImpl(null); break; case Evaluator.__Fields.CHAR_TYPE: field = new FieldImpl(char.Parse(value)); break; case Evaluator.__Fields.BYTE_TYPE: //byte b = Encoding.UTF8.GetBytes(value)[0]; field = new FieldImpl(byte.Parse(value)); break; case Evaluator.__Fields.SHORT_TYPE: field = new FieldImpl(short.Parse(value)); break; case Evaluator.__Fields.INTEGER_TYPE: field = new FieldImpl(int.Parse(value)); break; case Evaluator.__Fields.LONG_TYPE: field = new FieldImpl(long.Parse(value)); break; case Evaluator.__Fields.FLOAT_TYPE: field = new FieldImpl(float.Parse(value)); break; case Evaluator.__Fields.DOUBLE_TYPE: field = new FieldImpl(double.Parse(value)); break; case Evaluator.__Fields.BOOLEAN_TYPE: field = new FieldImpl(bool.Parse(value)); break; case Evaluator.__Fields.STRING_TYPE: field = new FieldImpl(value); break; case Evaluator.__Fields.DATE_TYPE: //MN: I think its fine like this, seems to work ! field = new FieldImpl(DateTime.Parse(value)); break; case Evaluator.__Fields.ARRAY_TYPE: //MN: I think its fine like this. field = new FieldImpl(value); break; case Evaluator.__Fields.OBJECT_TYPE: field = new FieldImpl(value); break; } return(field); }
public void TypeJInt2() { Integer i=new Integer(1); RegistryRecord record = Registry.GetRecord(i); Assert.IsNotNull(record); }
public virtual void setDeviceNumber(Integer deviceNumber) { if (deviceNumber != null) { try { if (this.frameGrabber != null) { try { Class @class = this.frameGrabber; Class[] classArray = new Class[1]; int index = 0; // ISSUE: variable of the null type __Null local = Integer.TYPE; classArray[index] = (Class) local; CallerID callerId = CameraDevice.SettingsImplementation.__\u003CGetCallerID\u003E(); @class.getConstructor(classArray, callerId); goto label_10; } catch (NoSuchMethodException ex) { } } else goto label_10; } catch (NoSuchMethodException ex) { goto label_6; } try { Class @class = this.frameGrabber; Class[] classArray = new Class[1]; int index = 0; // ISSUE: variable of the null type __Null local = ClassLiteral<Integer>.Value; classArray[index] = (Class) local; CallerID callerId = CameraDevice.SettingsImplementation.__\u003CGetCallerID\u003E(); @class.getConstructor(classArray, callerId); goto label_10; } catch (NoSuchMethodException ex) { } // ISSUE: variable of the null type __Null local1 = null; goto label_13; label_6: local1 = null; goto label_13; label_10: try { this.setDevicePath((string) null); this.setDeviceFile((File) null); goto label_14; } catch (NoSuchMethodException ex) { } local1 = null; label_13: string mess = new StringBuilder().append(this.frameGrabber.getSimpleName()).append(" does not accept a deviceNumber.").toString(); string str = "deviceNumber"; Integer integer = this.deviceNumber; CameraDevice.SettingsImplementation settingsImplementation = this; // ISSUE: variable of the null type __Null local2 = null; this.deviceNumber = (Integer) null; PropertyChangeEvent evt = new PropertyChangeEvent((object) this, str, (object) integer, (object) local2); Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new BaseChildSettings.PropertyVetoExceptionThatNetBeansLikes(mess, evt); } label_14: string description = this.getDescription(); string str1 = "deviceNumber"; Integer integer1 = this.deviceNumber; CameraDevice.SettingsImplementation settingsImplementation1 = this; Integer integer2 = deviceNumber; Integer integer3 = integer2; this.deviceNumber = integer2; this.firePropertyChange(str1, (object) integer1, (object) integer3); this.firePropertyChange("description", (object) description, (object) this.getDescription()); }
public virtual void setFrameGrabber(Class frameGrabber) { string description = this.getDescription(); string str1 = "frameGrabber"; Class class1 = this.frameGrabber; CameraDevice.SettingsImplementation settingsImplementation1 = this; Class class2 = frameGrabber; Class class3 = class2; this.frameGrabber = class2; this.firePropertyChange(str1, (object) class1, (object) class3); this.firePropertyChange("description", (object) description, (object) this.getDescription()); if (frameGrabber == null) { string str2 = "deviceNumber"; Integer integer = this.deviceNumber; CameraDevice.SettingsImplementation settingsImplementation2 = this; // ISSUE: variable of the null type __Null local1 = null; this.deviceNumber = (Integer) null; this.firePropertyChange(str2, (object) integer, (object) local1); string str3 = "deviceFile"; File file = this.deviceFile; CameraDevice.SettingsImplementation settingsImplementation3 = this; // ISSUE: variable of the null type __Null local2 = null; this.deviceFile = (File) null; this.firePropertyChange(str3, (object) file, (object) local2); string str4 = "devicePath"; string str5 = this.devicePath; CameraDevice.SettingsImplementation settingsImplementation4 = this; // ISSUE: variable of the null type __Null local3 = null; this.devicePath = (string) null; this.firePropertyChange(str4, (object) str5, (object) local3); } else { int num1 = 0; try { Class class4 = frameGrabber; Class[] classArray = new Class[1]; int index = 0; // ISSUE: variable of the null type __Null local = Integer.TYPE; classArray[index] = (Class) local; CallerID callerId = CameraDevice.SettingsImplementation.__\u003CGetCallerID\u003E(); class4.getConstructor(classArray, callerId); num1 = 1; goto label_9; } catch (NoSuchMethodException ex) { } try { Class class4 = frameGrabber; Class[] classArray = new Class[1]; int index = 0; // ISSUE: variable of the null type __Null local = ClassLiteral<Integer>.Value; classArray[index] = (Class) local; CallerID callerId = CameraDevice.SettingsImplementation.__\u003CGetCallerID\u003E(); class4.getConstructor(classArray, callerId); num1 = 1; goto label_9; } catch (NoSuchMethodException ex) { } string str2 = "deviceNumber"; Integer integer = this.deviceNumber; CameraDevice.SettingsImplementation settingsImplementation2 = this; // ISSUE: variable of the null type __Null local1 = null; this.deviceNumber = (Integer) null; this.firePropertyChange(str2, (object) integer, (object) local1); label_9: try { Class class4 = frameGrabber; Class[] classArray = new Class[1]; int index = 0; // ISSUE: variable of the null type __Null local2 = ClassLiteral<File>.Value; classArray[index] = (Class) local2; CallerID callerId = CameraDevice.SettingsImplementation.__\u003CGetCallerID\u003E(); class4.getConstructor(classArray, callerId); goto label_12; } catch (NoSuchMethodException ex) { } string str3 = "deviceFile"; File file = this.deviceFile; CameraDevice.SettingsImplementation settingsImplementation3 = this; // ISSUE: variable of the null type __Null local3 = null; this.deviceFile = (File) null; this.firePropertyChange(str3, (object) file, (object) local3); label_12: try { Class class4 = frameGrabber; Class[] classArray = new Class[1]; int index = 0; // ISSUE: variable of the null type __Null local2 = ClassLiteral<String>.Value; classArray[index] = (Class) local2; CallerID callerId = CameraDevice.SettingsImplementation.__\u003CGetCallerID\u003E(); class4.getConstructor(classArray, callerId); goto label_15; } catch (NoSuchMethodException ex) { } string str4 = "devicePath"; string str5 = this.devicePath; CameraDevice.SettingsImplementation settingsImplementation4 = this; // ISSUE: variable of the null type __Null local4 = null; this.devicePath = (string) null; this.firePropertyChange(str4, (object) str5, (object) local4); label_15: if (num1 == 0 || this.deviceNumber != null || this.deviceFile != null) return; if (this.devicePath != null) return; try { this.setDeviceNumber(Integer.valueOf(0)); } catch (Exception ex) { int num2 = 2; if (ByteCodeHelper.MapException<Exception>(ex, (ByteCodeHelper.MapFlags) num2) == null) throw; } } }
public virtual void setDeviceNumber(Integer deviceNumber) { this.si.setDeviceNumber(deviceNumber); }
private Integer[] getYears([In] int obj0) { int length = this.yearSelectionRange * 2 + 1; int num = obj0 - this.yearSelectionRange; Integer[] integerArray = new Integer[length]; for (int index = 0; index < length; ++index) integerArray[index] = new Integer(index + num); return integerArray; }
/// <summary> /// Convenience method for setting the layer attribute of this component. /// </summary> public void setLayer(Integer @layer) { }