Package org.pegasus.jmpi

Examples of org.pegasus.jmpi.UnsignedInt32


        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List uintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Long lng=new Long(Long.parseLong((arrayIt.next()).toString()));
          UnsignedInt32 uint32= new UnsignedInt32(lng.longValue());
          uintArray.add(uint32);
        }
        Object actualValue=(UnsignedInt32[])uintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }
      if(type==CIMDataType.UINT64_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List uintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Long lng=new Long(Long.parseLong((arrayIt.next()).toString()));
          BigInteger big=BigInteger.valueOf(lng.longValue());
          UnsignedInt64 uint64= new UnsignedInt64(big.abs());
          uintArray.add(uint64);
        }
        Object actualValue=(UnsignedInt64[])uintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }
      if(type==CIMDataType.SINT8_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Byte bt=new Byte(Byte.parseByte((arrayIt.next()).toString()));
          sintArray.add(bt);
        }
        Object actualValue=(Byte[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.SINT16_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Short bt=new Short(Short.parseShort((arrayIt.next()).toString()));
          sintArray.add(bt);
        }
        Object actualValue=(Short[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }
      if(type==CIMDataType.SINT32_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Integer bt=new Integer(Integer.parseInt((arrayIt.next()).toString()));
          sintArray.add(bt);
        }
        Object actualValue=(Integer[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.SINT64_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Long bt=new Long(Long.parseLong((arrayIt.next()).toString()));
          sintArray.add(bt);
        }
        Object actualValue=(Long[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.REAL32_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Float bt=new Float(Float.parseFloat((arrayIt.next()).toString()));
          sintArray.add(bt);
        }
        Object actualValue=(Float[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.REAL64_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Double bt=new Double(Double.parseDouble((arrayIt.next()).toString()));
          sintArray.add(bt);
        }
        Object actualValue=(Double[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.BOOLEAN_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Boolean bt=Boolean.valueOf((arrayIt.next()).toString());
          sintArray.add(bt);
        }
        Object actualValue=(Boolean[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }
      if(type==CIMDataType.CHAR16_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          Character bt=new Character(((arrayIt.next()).toString()).charAt(0));
          sintArray.add(bt);
        }
        Object actualValue=(Character[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.STRING_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List sintArray=new ArrayList();
        while(arrayIt.hasNext()){
          String bt=(arrayIt.next()).toString();
          sintArray.add(bt);
        }
        Object actualValue=(String[])sintArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }

      if(type==CIMDataType.DATETIME_ARRAY){
        if(!(CIMKeyValue instanceof List)){
          logger.severe(Thread.currentThread().getName()+" "+"expected a List");
          throw new SPLException("expected a List");
        }
        List intArray=(List)CIMKeyValue;
        Iterator arrayIt=intArray.iterator();
        List cimDateTimeArray=new ArrayList();
        while(arrayIt.hasNext()){
          Object ob=arrayIt.next();
          if(!(ob instanceof Calendar)){
            throw new SPLException("Value should be of type Calendar");
          }
          Calendar cal=(Calendar)ob;
          CIMDateTime calCIM=new CIMDateTime(cal.getTime());
          cimDateTimeArray.add(calCIM);
        }
        Object actualValue=(CIMDateTime[])cimDateTimeArray.toArray();
        cimval=new CIMValue(actualValue);                   
      }



    }else{
      if(type==CIMDataType.UINT8){
        Short sht=new Short(Short.parseShort(CIMKeyValue.toString()));
        UnsignedInt8 uint8= new UnsignedInt8(sht.shortValue());
        cimval=new CIMValue(uint8);
      }
      if(type==CIMDataType.UINT16){
        Integer integ=new Integer(Integer.parseInt(CIMKeyValue.toString()));
        UnsignedInt16 uint16= new UnsignedInt16(integ.intValue());
        cimval=new CIMValue(uint16);
      }
      if(type==CIMDataType.UINT32){
        Long lng=new Long(Long.parseLong(CIMKeyValue.toString()));
        UnsignedInt32 uint32= new UnsignedInt32(lng.longValue());
        cimval=new CIMValue(uint32);
      }
      if(type==CIMDataType.UINT64){
        Long shrt=new Long(Long.parseLong(CIMKeyValue.toString()));
        BigInteger big=BigInteger.valueOf(shrt.longValue());
View Full Code Here

TOP

Related Classes of org.pegasus.jmpi.UnsignedInt32

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.