Inheritance: java.util.AbstractList, List, RandomAccess, java.lang.Cloneable, java.io.Serializable
 private static ArrayList signatures([In] Class[] obj0, [In] Annotation[][] obj1)
 {
   ArrayList arrayList = new ArrayList();
   for (int index = 0; index < obj0.Length; ++index)
     arrayList.add((object) new ParameterSignature(obj0[index], obj1[index]));
   return arrayList;
 }
Exemple #2
0
        public static ArrayList jList(IEnumerable <string> ss)
        {
            var result = new ArrayList();

            each(ss, s => result.add(s));
            return(result);
        }
 public DowngradeActionMap()
 {
   base.\u002Ector();
   DowngradeActionMap downgradeActionMap = this;
   this.actionMap = new HashMap();
   this.actionList = new ArrayList();
 }
Exemple #4
0
        protected static ArrayList jList <T>(IEnumerable <T> ts, Converter <T, java.lang.Object> toJ)
        {
            var result = new ArrayList();

            each(ts, t => result.add(toJ(t)));
            return(result);
        }
Exemple #5
0
        void BuildListView(QStandardItemModel listModel, ListModel model)
        {
            listModel.setRowCount(model.GetItems().Count);
            listModel.setColumnCount(6);
            ArrayList list = new ArrayList();
            list.add("Extension");
            list.add("Color");
            list.add("Description");
            list.add("> Bytes");
            list.add("% Bytes");
            list.add("Files");
            listModel.setHorizontalHeaderLabels(list);
            int i = 0;
            foreach (var item in model.GetItems())
            {
                com.trolltech.qt.core.QModelIndex index = listModel.index(i, 0);
                listModel.setData(i, 0, item.Extension);
                listModel.setData(i, 1, item.Color.ToString());
                listModel.setData(i, 2, item.Description);
                listModel.setData(i, 3, ListModel.FormatSizeString(item.Bytes));
                listModel.setData(i, 4, string.Format("{0:P1}", (item.PercentBytes)));
                listModel.setData(i, 5, item.FileCount.ToString());

                i++;
            }
        }
 public KeyedComboBoxModel()
 {
   base.\u002Ector();
   KeyedComboBoxModel keyedComboBoxModel = this;
   this.data = new ArrayList();
   this.listdatalistener = new ArrayList();
 }
Exemple #7
0
        public EntityPainting(World world, int i, int j, int k, int l)
            : this(world)
        {
            xPosition = i;
            yPosition = j;
            zPosition = k;
            var arraylist = new ArrayList();
            EnumArt[] aenumart = EnumArt.values();
            int i1 = aenumart.Length;
            for (int j1 = 0; j1 < i1; j1++)
            {
                EnumArt enumart = aenumart[j1];
                art = enumart;
                func_179_a(l);
                if (onValidSurface())
                {
                    arraylist.add(enumart);
                }
            }

            if (arraylist.size() > 0)
            {
                art = (EnumArt) arraylist.get(rand.nextInt(arraylist.size()));
            }
            func_179_a(l);
        }
     : super(declaringType, name) {
     parameters = new ArrayList<ParameterInfo>();
     exceptions = new ArrayList<TypeInfo>();
     genericArguments = new ArrayList<TypeInfo>();
     annotations = new ArrayList<AnnotationValue>();
     codeGenerator = new CodeGenerator(this);
 }
        public List <CategoricalDistribution> AskFixedLagSmoothing(object owner, IContextLookup globalVars)
        {
            var model = HiddenMarkovModel.GetModel(owner, globalVars);

            var stateVar      = model.getStateVariable();
            var evidenceVar   = HiddenMarkovModel.ObservationVariable.GetRandomVariable(owner, globalVars);
            var randomVarDico = new Dictionary <string, RandomVariable> {
                { stateVar.getName(), stateVar }, { evidenceVar.getName(), evidenceVar }
            };

            var objAlgorithm = new FixedLagSmoothing(model, LagLength);

            var objEvidences = new java.util.ArrayList(Evidences.Count);
            var toReturn     = new List <CategoricalDistribution>();

            foreach (List <PropositionInfo> propositions in Evidences)
            {
                var stepEvidences = new java.util.ArrayList(propositions.Count);
                foreach (PropositionInfo proposition in propositions)
                {
                    stepEvidences.add(proposition.GetProposition(owner, globalVars, randomVarDico));
                }
                toReturn.Add(objAlgorithm.fixedLagSmoothing(stepEvidences));
            }
            return(toReturn);
        }
Exemple #10
0
 public override void getCollidingBoundingBoxes(World world, int i, int j, int k, AxisAlignedBB axisalignedbb,
     ArrayList arraylist)
 {
     int l = world.getBlockMetadata(i, j, k);
     if (l == 0)
     {
         setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
         setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
     }
     else if (l == 1)
     {
         setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
         setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
     }
     else if (l == 2)
     {
         setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
         setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
     }
     else if (l == 3)
     {
         setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
         setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
         base.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
     }
     setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
 }
        public List <CategoricalDistribution> DoForwardBackward(object owner, IContextLookup globalVars)
        {
            var randomVariables   = TemporalModel.TransitionModel.GetRandomVariables(owner, globalVars);
            var transitionalModel = new FiniteBayesModel(TemporalModel.TransitionModel.GetNetwork(randomVariables));

            randomVariables = TemporalModel.SensorModel.GetRandomVariables(owner, globalVars, randomVariables);
            var sensoryModel = new FiniteBayesModel(TemporalModel.SensorModel.GetNetwork(randomVariables));

            var temporalMap = TemporalModel.GetReverseTemporalMap(randomVariables);

            var forwardBackwardAlgorithm = new ForwardBackward(transitionalModel, temporalMap, sensoryModel);

            var objEvidences = new java.util.ArrayList(Evidences.Count);

            foreach (List <PropositionInfo> propositions in Evidences)
            {
                var stepEvidences = new java.util.ArrayList(propositions.Count);
                foreach (PropositionInfo proposition in propositions)
                {
                    stepEvidences.add(proposition.GetProposition(owner, globalVars, randomVariables));
                }
                objEvidences.add(stepEvidences);
            }

            CategoricalDistribution objPrior = Prior.GetProbabilityTable(randomVariables);

            return(forwardBackwardAlgorithm.forwardBackward(objEvidences, objPrior).toArray().Select(o => (CategoricalDistribution)o).ToList());
        }
		public void testConstructedGenericClass() {
			var typeSystem = new Library(new String[] { bin });
			var typeInfo = typeSystem.getType("stab/bytecode/test/classes/GenericClass");
			var args = new ArrayList<TypeInfo>();
			args.add(typeSystem.getType("java/lang/String"));
			doTest("ConstructedGenericClass", typeSystem.getGenericType(typeInfo, args));
		}
Exemple #13
0
        public static List readWatchableObjects(DataInputStream datainputstream)
        {
            ArrayList arraylist = null;
            for (byte byte0 = datainputstream.readByte(); byte0 != 127; byte0 = datainputstream.readByte())
            {
                if (arraylist == null)
                {
                    arraylist = new ArrayList();
                }
                int i = (byte0 & 0xe0) >> 5;
                int j = byte0 & 0x1f;
                WatchableObject watchableobject = null;
                switch (i)
                {
                    case 0: // '\0'
                        watchableobject = new WatchableObject(i, j, Byte.valueOf(datainputstream.readByte()));
                        break;

                    case 1: // '\001'
                        watchableobject = new WatchableObject(i, j, Short.valueOf(datainputstream.readShort()));
                        break;

                    case 2: // '\002'
                        watchableobject = new WatchableObject(i, j, Integer.valueOf(datainputstream.readInt()));
                        break;

                    case 3: // '\003'
                        watchableobject = new WatchableObject(i, j, Float.valueOf(datainputstream.readFloat()));
                        break;

                    case 4: // '\004'
                        watchableobject = new WatchableObject(i, j, datainputstream.readUTF());
                        break;

                    case 5: // '\005'
                        short word0 = datainputstream.readShort();
                        byte byte1 = datainputstream.readByte();
                        short word1 = datainputstream.readShort();
                        watchableobject = new WatchableObject(i, j, new ItemStack(word0, byte1, word1));

                        // fall through (not.. c#..)

                        int k2 = datainputstream.readInt();
                        int l2 = datainputstream.readInt();
                        int i12 = datainputstream.readInt();
                        watchableobject = new WatchableObject(i, j, new ChunkCoordinates(k2, l2, i12));

                        break;
                    case 6: // '\006'
                        int k = datainputstream.readInt();
                        int l = datainputstream.readInt();
                        int i1 = datainputstream.readInt();
                        watchableobject = new WatchableObject(i, j, new ChunkCoordinates(k, l, i1));
                        break;
                }
                arraylist.add(watchableobject);
            }

            return arraylist;
        }
 CodeGenerator(MethodBuilder method) {
     this.instructions = new ArrayList<Instruction>();
     this.method = method;
     this.scopes = new ArrayList<ScopeInfo>();
     this.locals = new ArrayList<LocalInfo>();
     this.exceptionTable = new ArrayList<ExceptionHandler>();
     this.lineNumbers = new ArrayList<LineNumberInfo>();
 }
 public DefaultKeyedValues()
 {
   base.\u002Ector();
   DefaultKeyedValues defaultKeyedValues = this;
   this.keys = new ArrayList();
   this.values = new ArrayList();
   this.indexMap = new HashMap();
 }
 private Description(string _param1, params Annotation[] _param2)
 {
   base.\u002Ector();
   Description description = this;
   this.fChildren = new ArrayList();
   this.fDisplayName = param0;
   this.fAnnotations = param1;
 }
Exemple #17
0
        public void CanSetAlertHandler()
        {
            var webClient = new WebClient(BrowserVersion.FIREFOX_38);

            List collectedAlerts = new ArrayList();
            var alertHandler = new CollectingAlertHandler(collectedAlerts);
            webClient.AlertHandler = alertHandler;
        }
 public Parameterized(Class klass)
   : base(klass, Collections.emptyList())
 {
   Parameterized parameterized = this;
   this.runners = new ArrayList();
   List parametersList = this.getParametersList(this.getTestClass());
   for (int index = 0; index < parametersList.size(); ++index)
     this.runners.add((object) new Parameterized.TestClassRunnerForParameters(this, this.getTestClass().getJavaClass(), parametersList, index));
 }
 public LWSubsystem()
   : base(true)
 {
   LWSubsystem lwSubsystem = this;
   this.preferredSize = new Dimension(100, 100);
   this.selected = (Widget) null;
   this.widgets = new ArrayList(20);
   MainPanel.getPanel("LiveWindow").addSubsystem(this);
 }
			public override void clear () {
				List names = new ArrayList ();
				for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {
					names.add (e.nextElement ());
				}

				for (Iterator it = names.iterator (); it.hasNext (); ) {
					removeAttribute ((String) it.next ());
				}
			}
 private void validate()
 {
   ArrayList arrayList1 = new ArrayList();
   this.collectInitializationErrors((List) arrayList1);
   if (((List) arrayList1).isEmpty())
     return;
   ArrayList arrayList2 = arrayList1;
   Throwable.__\u003CsuppressFillInStackTrace\u003E();
   throw new InitializationError((List) arrayList2);
 }
    public static void sort(List modules)
    {
      HashMap hashMap = new HashMap();
      ArrayList arrayList1 = new ArrayList();
      ArrayList arrayList2 = new ArrayList();
      for (int index = 0; index < modules.size(); ++index)
      {
        PackageState packageState = (PackageState) modules.get(index);
        if (packageState.getState() == -2)
        {
          arrayList1.add((object) packageState);
        }
        else
        {
          PackageSorter.SortModule sortModule = new PackageSorter.SortModule(packageState);
          arrayList2.add((object) sortModule);
          hashMap.put((object) packageState.getModule().getModuleClass(), (object) sortModule);
        }
      }
      PackageSorter.SortModule[] sortModuleArray = (PackageSorter.SortModule[]) arrayList2.toArray((object[]) new PackageSorter.SortModule[arrayList2.size()]);
      for (int index = 0; index < sortModuleArray.Length; ++index)
      {
        PackageSorter.SortModule sortModule = sortModuleArray[index];
        sortModule.setDependSubsystems(PackageSorter.collectSubsystemModules(sortModule.getState().getModule(), hashMap));
      }
      int num1 = 1;
label_10:
      while (num1 != 0)
      {
        num1 = 0;
        int index = 0;
        while (true)
        {
          if (index < sortModuleArray.Length)
          {
            PackageSorter.SortModule sortModule = sortModuleArray[index];
            int num2 = PackageSorter.searchModulePosition(sortModule, hashMap);
            if (num2 != sortModule.getPosition())
            {
              sortModule.setPosition(num2);
              num1 = 1;
            }
            ++index;
          }
          else
            goto label_10;
        }
      }
      Arrays.sort((object[]) sortModuleArray);
      modules.clear();
      for (int index = 0; index < sortModuleArray.Length; ++index)
        modules.add((object) sortModuleArray[index].getState());
      for (int index = 0; index < arrayList1.size(); ++index)
        modules.add(arrayList1.get(index));
    }
 public static void removeCodeBase(URL codeBase, URLClassLoader urlClassLoader)
 {
   ArrayList arrayList = new ArrayList();
   URL[] urLs = urlClassLoader.getURLs();
   for (int index = 0; index < urLs.Length; ++index)
   {
     if (!urLs[index].sameFile(codeBase))
       ((List) arrayList).add((object) urLs[index]);
   }
   ResourceBundleWrapper.noCodeBaseClassLoader = URLClassLoader.newInstance((URL[]) ((List) arrayList).toArray((object[]) new URL[0]));
 }
Exemple #24
0
        /// <summary>
        /// converts object list to int array
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        public static int[] ToInt32Array(java.util.ArrayList u)
        {
            int[] x = new int[u.size()];

            for (int i = 0; i < u.size(); i++)
            {
                x[i] = (int)u.get(i);
            }

            return(x);
        }
Exemple #25
0
    //**************************************************************************************

    protected override weka.core.Attribute GetDependentAttribute()
    {
        java.util.List PL_values = new java.util.ArrayList();
        PL_values.add("WeakSell");
        PL_values.add("WeakBuy");
        PL_values.add("Buy");
        PL_values.add("Sell");
        PL_values.add("StrongBuy");
        PL_values.add("StrongSell");
        return(new weka.core.Attribute("PL", PL_values));
    }
Exemple #26
0
        public virtual void onCraftGuiOpened(ICrafting icrafting)
        {
            crafters.add(icrafting);
            var arraylist = new ArrayList();
            for (int i = 0; i < inventorySlots.size(); i++)
            {
                arraylist.add(((Slot) inventorySlots.get(i)).getStack());
            }

            icrafting.updateCraftingInventory(this, arraylist);
            updateCraftingMatrix();
        }
 public static Matcher hasItems(params Matcher[] elementMatchers)
 {
   ArrayList arrayList = new ArrayList(elementMatchers.Length);
   Matcher[] matcherArray = elementMatchers;
   int length = matcherArray.Length;
   for (int index = 0; index < length; ++index)
   {
     Matcher elementMatcher = matcherArray[index];
     ((Collection) arrayList).add((object) IsCollectionContaining.hasItem(elementMatcher));
   }
   return AllOf.allOf((Iterable) arrayList);
 }
Exemple #28
0
 private List parseName([In] string obj0)
 {
   ArrayList arrayList = new ArrayList();
   StringTokenizer stringTokenizer = new StringTokenizer(obj0, "/");
   while (stringTokenizer.hasMoreElements())
   {
     string str = (string) stringTokenizer.nextElement();
     if (String.instancehelper_length(str) != 0)
       arrayList.add((object) str);
   }
   return (List) arrayList;
 }
Exemple #29
0
 public NetworkListenThread(MinecraftServer minecraftserver, InetAddress inetaddress, int i)
 {
     field_973_b = false;
     field_977_f = 0;
     pendingConnections = new ArrayList();
     playerList = new ArrayList();
     mcServer = minecraftserver;
     serverSocket = new ServerSocket(i, 0, inetaddress);
     serverSocket.setPerformancePreferences(0, 2, 1);
     field_973_b = true;
     networkAcceptThread = new NetworkAcceptThread(this, "Listen thread", minecraftserver);
     networkAcceptThread.start();
 }
 private static List getLibraries([In] ProjectInfo obj0)
 {
   if (obj0 == null)
   {
     return (List) new ArrayList();
   }
   else
   {
     ArrayList arrayList = new ArrayList();
     LibraryPanel.collectLibraries(obj0, (List) arrayList);
     return (List) arrayList;
   }
 }
Exemple #31
0
        public Iterator getResourceURIs(JXPathContext xpc)
        {
            java.util.List iter = new java.util.ArrayList();
            if (resourceCollection != null)
            {
                List <string> list = resourceCollection.GetResourceURIs(new DynamicContext(xpc));
                foreach (string src in list)
                {
                    iter.add(src);
                }
            }

            return(iter.iterator());
        }
Exemple #32
0
 public VectorClassif(int nbTags)
 {
     tagsNb = nbTags;
     ArrayList nomi = new ArrayList();
     nomi.add("0");
     nomi.add("1");
     ArrayList attr = new ArrayList();
     weka.core.Attribute stringAttr = new weka.core.Attribute("todoString", (List)null);
     attr.add(stringAttr);
     for (int i = 1; i <= nbTags; i++) {
         attr.add(new weka.core.Attribute("label" + i, nomi));
     }
     oDataSet = new Instances("Todo-Instances", attr, 500);
 }
 public ClassSignature parseClassSignature() {
     var result = new ClassSignature();
     if (current == '<') {
         result.formalTypeParameters = parseFormalTypeParameters();
     } else {
         result.formalTypeParameters = Collections.emptyList<TypeSignature>();
     }
     result.superclass = parseClassTypeSignature();
     var superinterfaces = new ArrayList<TypeSignature>();
     result.superinterfaces = superinterfaces;
     while (current != -1) {
         superinterfaces.add(parseClassTypeSignature());
     }
     return result;
 }
 public AbstractTabbedUI()
 {
   base.\u002Ector();
   AbstractTabbedUI abstractTabbedUi = this;
   this.selectedRootEditor = -1;
   this.toolbarContainer = new JPanel();
   ((Container) this.toolbarContainer).setLayout((LayoutManager) new BorderLayout());
   this.tabbedPane = new JTabbedPane(3);
   this.tabbedPane.addChangeListener((ChangeListener) new AbstractTabbedUI.TabChangeHandler(this, this.tabbedPane));
   this.rootEditors = new ArrayList();
   ((Container) this).setLayout((LayoutManager) new BorderLayout());
   ((Container) this).add((Component) this.toolbarContainer, (object) "North");
   ((Container) this).add((Component) this.tabbedPane, (object) "Center");
   this.closeAction = this.createCloseAction();
 }
 public virtual BootableProjectInfo[] getDependencies()
 {
   ArrayList arrayList = new ArrayList();
   foreach (Library library in this.getLibraries())
   {
     if (library is BootableProjectInfo)
       arrayList.add((object) library);
   }
   foreach (Library library in this.getOptionalLibraries())
   {
     if (library is BootableProjectInfo)
       arrayList.add((object) library);
   }
   return (BootableProjectInfo[]) arrayList.toArray((object[]) new BootableProjectInfo[arrayList.size()]);
 }
Exemple #36
0
        public virtual void shuffle()
        {
            java.util.ArrayList rowlist = new java.util.ArrayList();
            for (int i = 0; i < rows.Count; i++)
            {
                rowlist.add(rows[i]);
            }
            Collections.shuffle(rowlist);
            List <DataSetRow> _rows = new List <DataSetRow>();

            for (int i = 0; i < rows.Count; i++)
            {
                _rows.Add((DataSetRow)rowlist.get(i));
            }
            rows = _rows;
        }
Exemple #37
0
		List<Map<String,Object>> getData ()
		{
			var list = new ArrayList<Map<String,Object>> ();
			foreach (Type type in Assembly.GetExecutingAssembly ().GetTypes ()) {
				var attrs = type.GetCustomAttributes (typeof(TestAttribute), false);
				if ((attrs == null) || (attrs.Length != 1))
					continue;

				var attr = (TestAttribute)attrs [0];
				var map = new HashMap<String,Object> ();
				map.put ("title", attr.Name);
				map.put ("type", type);
				list.add (Collections.unmodifiableMap (map));
			}
			return Collections.unmodifiableList (list);
		}
 private PackageManager([In] AbstractBoot obj0)
 {
   base.\u002Ector();
   PackageManager packageManager = this;
   if (obj0 == null)
   {
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new NullPointerException();
   }
   else
   {
     this.booter = obj0;
     this.packageConfiguration = new PackageManager.PackageConfiguration();
     this.modules = new ArrayList();
     this.initSections = new ArrayList();
   }
 }
        public List <AssignmentProposition[][]> AskParticleFiltering(object owner, IContextLookup globalVars)
        {
            var randomVars = DynamicBayesianNetwork.GetRandomVariables(owner, globalVars);
            var model      = DynamicBayesianNetwork.GetNetwork(randomVars);

            Randomizer objRandomizer;

            switch (RandomizerType)
            {
            case RandomizerType.Random:
                objRandomizer = new JavaRandomizer();
                break;

            case RandomizerType.Mock:
                objRandomizer = new MockRandomizer(RandomizerValues.ToArray());
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            var objAlgorithm = new ParticleFiltering(SampleNb, (DynamicBayesianNetwork)model, objRandomizer);

            var objEvidences = new java.util.ArrayList(Evidences.Count);
            var toReturn     = new List <AssignmentProposition[][]>();

            foreach (List <PropositionInfo> propositions in Evidences)
            {
                var stepEvidences = new List <AssignmentProposition>(propositions.Count);
                foreach (PropositionInfo proposition in propositions)
                {
                    stepEvidences.Add((AssignmentProposition)proposition.GetProposition(owner, globalVars, randomVars));
                }
                toReturn.Add(objAlgorithm.particleFiltering(stepEvidences.Cast <AssignmentProposition>().ToArray()));
            }
            return(toReturn);
        }
        protected void btn_Insertar_Click(object sender, EventArgs e)
        {
            string path = Server.MapPath("~/Tramas");
            string file = rbOk.Checked ? "ok.txt" : "error.txt";

            path = path + @"\" + file;

            //Leyendo la trama XML
            XmlDocument _Doc = new XmlDocument();

            _Doc.Load(path);
            var ser = new XmlSerializer(typeof(Online997RegafiUpdateResponse));
            var _Online997RegafiUpdateResponse = (Online997RegafiUpdateResponse)ser.Deserialize(new StringReader(_Doc.OuterXml));

            //Convirtiendo el campo "txRespuesta" a un objeto
            RegafiUpdate997ServiceImpl impl = new RegafiUpdate997ServiceImpl();
            var objetorespuesta             = impl.x12NToBean(_Online997RegafiUpdateResponse.txRespuesta);

            // ---> Obteniendo valores de la respuesta
            var excProceso    = objetorespuesta.getExcProceso();
            var feTransaccion = objetorespuesta.getFeTransaccion();
            var flag          = objetorespuesta.isFlag();
            var hoTransaccion = objetorespuesta.getHoTransaccion();
            var IdCorrelativo = objetorespuesta.getIdCorrelativo();
            var idReceptor    = objetorespuesta.getIdReceptor();
            var idRemitente   = objetorespuesta.getIdRemitente();
            var idTransaccion = objetorespuesta.getIdTransaccion();

            //Obteniendo lista de errores
            java.util.List ListaErrores = new java.util.ArrayList();
            ListaErrores = objetorespuesta.getIn271RegafiUpdateExcepcion();

            var noTransaccion = objetorespuesta.getNoTransaccion();
            var nuControl     = objetorespuesta.getNuControl();
            var nuControlST   = objetorespuesta.getNuControlST();

            // ---> Cargando el objeto a insertar
            TAB_SUSALUD objCabecera = new TAB_SUSALUD();

            objCabecera.SCERTYPE        = "1";
            objCabecera.NBRANCH         = 1200;
            objCabecera.NPRODUCT        = 2200;
            objCabecera.NPOLICY         = 3020;
            objCabecera.NCERTIF         = 2562;
            objCabecera.DEFFECDATE      = DateTime.Now;
            objCabecera.NCORRELATIVO    = Convert.ToDecimal(IdCorrelativo);
            objCabecera.STIPO_OPERACION = "10"; //10: Actualiza, Afiliado y Afiliación
            //Verificando si hay errores a nivel del servicio y a nivel de base de datos
            if ((excProceso == EstadoServicio.Todo_Correcto) && !ExisteErrorBD(ListaErrores))
            {
                //Es correcto
                objCabecera.SESTADO_SUSALUD = EstadoTransaccion.Satisfactorio;
            }
            else
            {
                //Hay errores
                objCabecera.SESTADO_SUSALUD = EstadoTransaccion.Error;
            }

            //Cargando el detalle del error
            string coCampoErr             = "";
            string excBD                  = "";
            string inCoErrorEncontrado    = "";
            string pkAfiliado             = "";
            string pkAfiliadopkAfiliacion = "";

            List <TAB_SUSALUD_OBSERV> _Lista_Observaciones = new List <TAB_SUSALUD_OBSERV>();

            TAB_SUSALUD_OBSERV objDetalle = new TAB_SUSALUD_OBSERV();

            //Cuando no hay errores en el servicio y en la base de datos a la vez
            if ((excProceso == EstadoServicio.Todo_Correcto) && !ExisteErrorBD(ListaErrores))
            {
                //Solo debe de haber un registro con el campo excBD = "0000"
                foreach (In997RegafiUpdateExcepcion item in ListaErrores.toArray())
                {
                    coCampoErr             = item.getCoCampoErr();
                    excBD                  = item.getExcBD();
                    inCoErrorEncontrado    = item.getInCoErrorEncontrado();
                    pkAfiliado             = item.getPkAfiliado();
                    pkAfiliadopkAfiliacion = item.getPkAfiliadopkAfiliacion();
                }
                objDetalle.NCODIGO_OBS  = 0; // No se llena porque es un correlativo, y se ingresa con un secuencial;
                objDetalle.NCORRELATIVO = Convert.ToDecimal(IdCorrelativo);
                objDetalle.PKAFILIADO   = pkAfiliado;
                objDetalle.PKAFILIACION = pkAfiliadopkAfiliacion;
                objDetalle.NTIPO_ERROR  = TipoError.Sin_Error;
                objDetalle.SID_ERROR    = "0";
                objDetalle.SDESCRIPCION_ERROR_SERVICIO = "";
                objDetalle.SDESCRIPCION_ERROR_BD       = "";
                objDetalle.SID_CAMPO            = "";
                objDetalle.SNOMBRE_CAMPO        = "";
                objDetalle.SID_REGLA_AFILIACION = "";

                _Lista_Observaciones.Add(objDetalle);
                objCabecera.DETALLE = _Lista_Observaciones;
            }

            //Cuando hay error en el servicio
            coCampoErr             = "";
            excBD                  = "";
            inCoErrorEncontrado    = "";
            pkAfiliado             = "";
            pkAfiliadopkAfiliacion = "";

            if (excProceso != EstadoServicio.Todo_Correcto)
            {
                foreach (In997RegafiUpdateExcepcion item in ListaErrores.toArray())
                {
                    coCampoErr             = item.getCoCampoErr();
                    excBD                  = item.getExcBD();
                    inCoErrorEncontrado    = item.getInCoErrorEncontrado();
                    pkAfiliado             = item.getPkAfiliado();
                    pkAfiliadopkAfiliacion = item.getPkAfiliadopkAfiliacion();
                }
                objDetalle.NCODIGO_OBS  = 0; // No se llena porque es un correlativo, y se ingresa con un secuencial;
                objDetalle.NCORRELATIVO = Convert.ToDecimal(IdCorrelativo);
                objDetalle.PKAFILIADO   = pkAfiliado;
                objDetalle.PKAFILIACION = pkAfiliadopkAfiliacion;
                objDetalle.NTIPO_ERROR  = TipoError.Error_Servicio;
                objDetalle.SID_ERROR    = excProceso;
                objDetalle.SDESCRIPCION_ERROR_SERVICIO = ""; //Se llena por base de datos
                objDetalle.SDESCRIPCION_ERROR_BD       = "";
                objDetalle.SID_CAMPO            = "";
                objDetalle.SNOMBRE_CAMPO        = "";
                objDetalle.SID_REGLA_AFILIACION = "";

                _Lista_Observaciones.Add(objDetalle);
                objCabecera.DETALLE = _Lista_Observaciones;
            }

            //Cuando hay errores en la base de datos
            coCampoErr             = "";
            excBD                  = "";
            inCoErrorEncontrado    = "";
            pkAfiliado             = "";
            pkAfiliadopkAfiliacion = "";

            if ((excProceso == EstadoServicio.Todo_Correcto) && ExisteErrorBD(ListaErrores))
            {
                foreach (In997RegafiUpdateExcepcion item in ListaErrores.toArray())
                {
                    coCampoErr             = item.getCoCampoErr();
                    excBD                  = item.getExcBD();
                    inCoErrorEncontrado    = item.getInCoErrorEncontrado();
                    pkAfiliado             = item.getPkAfiliado();
                    pkAfiliadopkAfiliacion = item.getPkAfiliadopkAfiliacion();

                    objDetalle.NCODIGO_OBS  = 0; // No se llena porque es un correlativo, y se ingresa con un secuencial;
                    objDetalle.NCORRELATIVO = Convert.ToDecimal(IdCorrelativo);
                    objDetalle.PKAFILIADO   = pkAfiliado;
                    objDetalle.PKAFILIACION = pkAfiliadopkAfiliacion;
                    objDetalle.NTIPO_ERROR  = TipoError.Error_BD;
                    objDetalle.SID_ERROR    = excBD;
                    objDetalle.SDESCRIPCION_ERROR_SERVICIO = "";
                    objDetalle.SDESCRIPCION_ERROR_BD       = ""; //Se llena por base de datos
                    objDetalle.SID_CAMPO            = coCampoErr;
                    objDetalle.SNOMBRE_CAMPO        = "";        //Se llena por base de datos;
                    objDetalle.SID_REGLA_AFILIACION = inCoErrorEncontrado;

                    _Lista_Observaciones.Add(objDetalle);
                }

                objCabecera.DETALLE = _Lista_Observaciones;
            }

            //Insertando
            int result = InsertarResultado(objCabecera);
        }
Exemple #41
0
        public string GetText(PDDocument pdfDocument, bool format)
        {
            string text;
            double num;
            string str = "";

            if (format)
            {
                try
                {
                    PDFHelper.DisplayTrialPopupIfNecessary();
                    PDFTextStripperByArea pDFTextStripperByArea = new PDFTextStripperByArea();
                    if (PDFHelper.AddStamp)
                    {
                        str = string.Concat(str, "You are using a trial license of PDF Toolkit, as a result only the first three pages would be extracted.");
                        pDFTextStripperByArea.setEndPage(3);
                    }
                    pDFTextStripperByArea.setSortByPosition(true);
                    java.util.List arrayList = new java.util.ArrayList();
                    PDPageTree     pages     = pdfDocument.getPages();
                    arrayList.size();
                    foreach (PDPage page in pages)
                    {
                        if ((!PDFHelper.AddStamp ? true : pages.indexOf(page) <= 2))
                        {
                            PDRectangle cropBox  = page.getCropBox();
                            int         rotation = page.getRotation();
                            if (cropBox == null)
                            {
                                cropBox = page.getMediaBox();
                            }
                            int num1 = 0;
                            int num2 = 0;
                            if (rotation % 180 != 0)
                            {
                                num  = Math.Round((double)cropBox.getWidth());
                                num1 = int.Parse(num.ToString()) - 50;
                                num  = Math.Round((double)cropBox.getHeight());
                                num2 = int.Parse(num.ToString()) - 50;
                            }
                            else
                            {
                                num  = Math.Round((double)cropBox.getHeight());
                                num1 = int.Parse(num.ToString()) - 50;
                                num  = Math.Round((double)cropBox.getWidth());
                                num2 = int.Parse(num.ToString()) - 50;
                            }
                            pDFTextStripperByArea.addRegion("class1", new java.awt.Rectangle(0, 0, num2, num1));
                            pDFTextStripperByArea.extractRegions(page);
                            str = string.Concat(str, pDFTextStripperByArea.getTextForRegion("class1"));
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                catch (Exception exception1)
                {
                    Exception exception = exception1;
                    throw new PDFToolkitException(exception.Message, exception.InnerException);
                }
                text = str;
            }
            else
            {
                text = this.GetText(pdfDocument);
            }
            return(text);
        }
Exemple #42
0
    //**************************************************************************************

    /// <summary>
    /// Creates and fills in weka instances object.
    /// </summary>
    protected static weka.core.Instances CreateInstances(CandlestickCollection iCandlesticks, List <int> iTrainingPoints, java.util.ArrayList iAttributes, List <ClassifierParameter> iParameters, Candlestick.Period iPeriod, int iMaxProfitTime)
    {
        int dataSize = iTrainingPoints.Count;

        // Create instance object
        var instances = new weka.core.Instances("Data", iAttributes, dataSize);

        // Set class index
        instances.setClassIndex(instances.numAttributes() - 1);

        // Fill instances
        FillInstances(instances, CalculateDecisions(iCandlesticks[kTrainingPeriod], iTrainingPoints, iMaxProfitTime), CalculateParameters(iParameters, iCandlesticks, iTrainingPoints, iPeriod));

        return(instances);
    }
Exemple #43
0
        private void SubsetFontFile(string subsetString, java.io.File paramFile1, java.io.File paramFile2)
        {
            FontFactory localFontFactory = FontFactory.getInstance();

            java.io.FileInputStream localFileInputStream = null;
            try
            {
                localFileInputStream = new java.io.FileInputStream(paramFile1);
                byte[] arrayOfByte = new byte[(int)paramFile1.length()];
                localFileInputStream.read(arrayOfByte);
                Font[] arrayOfFont = null;
                arrayOfFont = localFontFactory.loadFonts(arrayOfByte);
                Font localFont1 = arrayOfFont[0];
                java.util.ArrayList localArrayList = new java.util.ArrayList();
                localArrayList.add(CMapTable.CMapId.WINDOWS_BMP);
                //java.lang.Object localObject1 = null;
                java.lang.Object localObject2 = null;

                Font             localFont2 = localFont1;
                java.lang.Object localObject3;
                if (subsetString != null)
                {
                    localObject2 = new RenumberingSubsetter(localFont2, localFontFactory);
                    ((Subsetter)localObject2).setCMaps(localArrayList, 1);
                    localObject3 = (java.lang.Object)GlyphCoverage.getGlyphCoverage(localFont1, subsetString);
                    ((Subsetter)localObject2).setGlyphs((java.util.List)localObject3);
                    var localHashSet = new java.util.HashSet();
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.GDEF));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.GPOS));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.GSUB));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.kern));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.hdmx));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.vmtx));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.VDMX));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.LTSH));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.DSIG));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.intValue(new byte[] { 109, 111, 114, 116 })));
                    localHashSet.add(java.lang.Integer.valueOf(SfntlyTag.intValue(new byte[] { 109, 111, 114, 120 })));
                    ((Subsetter)localObject2).setRemoveTables(localHashSet);
                    localFont2 = ((Subsetter)localObject2).subset().build();
                }
                if (this.strip)
                {
                    localObject2 = new HintStripper(localFont2, localFontFactory);
                    localObject3 = new HashSet();
                    ((Set)localObject3).add(Integer.valueOf(Tag.fpgm));
                    ((Set)localObject3).add(Integer.valueOf(Tag.prep));
                    ((Set)localObject3).add(Integer.valueOf(Tag.cvt));
                    ((Set)localObject3).add(Integer.valueOf(Tag.hdmx));
                    ((Set)localObject3).add(Integer.valueOf(Tag.VDMX));
                    ((Set)localObject3).add(Integer.valueOf(Tag.LTSH));
                    ((Set)localObject3).add(Integer.valueOf(Tag.DSIG));
                    ((Subsetter)localObject2).setRemoveTables((Set)localObject3);
                    localFont2 = ((Subsetter)localObject2).subset().build();
                }
                localObject2 = new java.io.FileOutputStream(paramFile2);
                if (this.woff)
                {
                    localObject3 = new WoffWriter().convert(localFont2);
                    ((WritableFontData)localObject3).copyTo((OutputStream)localObject2);
                }
                else if (this.eot)
                {
                    localObject3 = new EOTWriter(this.mtx).convert(localFont2);
                    ((WritableFontData)localObject3).copyTo((OutputStream)localObject2);
                }
                else
                {
                    localFontFactory.serializeFont(localFont2, (OutputStream)localObject2);
                }
            }
            catch (System.Exception ex)
            {
                throw new System.Exception(ex.Message);
            }
        }