Package org.sblim.wbem.cim

Examples of org.sblim.wbem.cim.CIMDateTime


          Object ob=arrayIt.next();
          if(!(ob instanceof Calendar)){
            throw new SPLException("Value should be of type Calendar");
          }
          Calendar cal=(Calendar)ob;
          CIMDateTime calCIM=new CIMSimpleDateTime(cal);
          cimDateTimeArray.add(calCIM);
        }
        Object actualValue=(CIMDateTime[])cimDateTimeArray.toArray();
        CIMDataType calArrType = new CIMDataType(CIMDataType.DATETIME_ARRAY);
        cimval=new CIMValue(actualValue,calArrType);                   
      }
      break;
   
      case CIMDataType.UINT8:
      {
        Short sht=new Short(Short.parseShort(CIMKeyValue.toString()));
        UnsignedInt8 uint8= new UnsignedInt8(sht.shortValue());
        CIMDataType uint8Type = new CIMDataType(CIMDataType.UINT8);
        cimval=new CIMValue(uint8,uint8Type);
      }
      break;
      case CIMDataType.UINT16:
      {
        Integer integ=new Integer(Integer.parseInt(CIMKeyValue.toString()));
        UnsignedInt16 uint16= new UnsignedInt16(integ.intValue());
        CIMDataType uint16Type = new CIMDataType(CIMDataType.UINT16);
        cimval=new CIMValue(uint16,uint16Type);
      }
      break;
      case CIMDataType.UINT32:
      {
        Long lng=new Long(Long.parseLong(CIMKeyValue.toString()));
        UnsignedInt32 uint32= new UnsignedInt32(lng.longValue());
        CIMDataType uint32Type = new CIMDataType(CIMDataType.UINT32);
        cimval=new CIMValue(uint32,uint32Type);
      }
      break;
      case CIMDataType.UINT64:
      {
        Long shrt=new Long(Long.parseLong(CIMKeyValue.toString()));
        BigInteger big=BigInteger.valueOf(shrt.longValue());
        UnsignedInt64 uint64= new UnsignedInt64(big.abs());
        CIMDataType uint64Type = new CIMDataType(CIMDataType.UINT64);
        cimval=new CIMValue(uint64,uint64Type);
      }
      break;
      case CIMDataType.SINT8:
      {
        Byte byt=new Byte(Byte.parseByte(CIMKeyValue.toString()));
        CIMDataType sint8Type = new CIMDataType(CIMDataType.SINT8);
        cimval=new CIMValue(byt,sint8Type);
      }
      break;
      case CIMDataType.SINT16:
      {
        Short sht=new Short(Short.parseShort(CIMKeyValue.toString()));
        CIMDataType sint16Type = new CIMDataType(CIMDataType.SINT16);
        cimval=new CIMValue(sht,sint16Type);
      }
      break;
      case CIMDataType.SINT32:
      {
        Integer integ=new Integer(Integer.parseInt(CIMKeyValue.toString()));
        CIMDataType sint32Type = new CIMDataType(CIMDataType.SINT32);
        cimval=new CIMValue(integ,sint32Type);
      }
      break;
      case CIMDataType.SINT64:
      {
        Long lng=new Long(Long.parseLong(CIMKeyValue.toString()));
        CIMDataType sint64Type = new CIMDataType(CIMDataType.SINT64);
        cimval=new CIMValue(lng,sint64Type);
      }
      break;
      case CIMDataType.REAL32:
      {
        Float flt=new Float(Float.parseFloat(CIMKeyValue.toString()));
        CIMDataType real32Type = new CIMDataType(CIMDataType.REAL32);
        cimval=new CIMValue(flt,real32Type);
      }
      break;
      case CIMDataType.REAL64:
      {
        Double dbl=new Double(Double.parseDouble(CIMKeyValue.toString()));
        CIMDataType real64Type = new CIMDataType(CIMDataType.REAL64);
        cimval=new CIMValue(dbl,real64Type);
      }
      break;
      case CIMDataType.CHAR16:
      {
        Character cha=new Character((CIMKeyValue.toString()).charAt(0));
        CIMDataType char16Type = new CIMDataType(CIMDataType.CHAR16);
        cimval=new CIMValue(cha,char16Type);
      }
      break;
      case CIMDataType.BOOLEAN:
      {
        Boolean booln=Boolean.valueOf(CIMKeyValue.toString());
        CIMDataType boolType = new CIMDataType(CIMDataType.BOOLEAN);
        cimval=new CIMValue(booln,boolType);
      }
      break;
      case CIMDataType.STRING:
      {
        String str=CIMKeyValue.toString();
        CIMDataType stringType = new CIMDataType(CIMDataType.STRING);
        cimval=new CIMValue(str,stringType);
      }
      break;
      case CIMDataType.DATETIME:
      {
        if(!(CIMKeyValue instanceof Calendar)){
          throw new SPLException("Value should be of type Calendar");
        }
        Calendar cal=(Calendar)CIMKeyValue;
        CIMDateTime calCIM=new CIMSimpleDateTime(cal);
        CIMDataType calType = new CIMDataType(CIMDataType.DATETIME);
        cimval=new CIMValue(calCIM,calType);
      }
      break;
      default:
View Full Code Here

TOP

Related Classes of org.sblim.wbem.cim.CIMDateTime

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.