SMSEncoder.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. package org.doubango.tinyWRAP;
  9. public class SMSEncoder {
  10. private long swigCPtr;
  11. protected boolean swigCMemOwn;
  12. protected SMSEncoder(long cPtr, boolean cMemoryOwn) {
  13. swigCMemOwn = cMemoryOwn;
  14. swigCPtr = cPtr;
  15. }
  16. protected static long getCPtr(SMSEncoder obj) {
  17. return (obj == null) ? 0 : obj.swigCPtr;
  18. }
  19. protected void finalize() {
  20. delete();
  21. }
  22. public synchronized void delete() {
  23. if (swigCPtr != 0) {
  24. if (swigCMemOwn) {
  25. swigCMemOwn = false;
  26. tinyWRAPJNI.delete_SMSEncoder(swigCPtr);
  27. }
  28. swigCPtr = 0;
  29. }
  30. }
  31. public static RPMessage encodeSubmit(int mr, String smsc, String destination, String ascii) {
  32. long cPtr = tinyWRAPJNI.SMSEncoder_encodeSubmit(mr, smsc, destination, ascii);
  33. return (cPtr == 0) ? null : new RPMessage(cPtr, true);
  34. }
  35. public static RPMessage encodeDeliver(int mr, String smsc, String originator, String ascii) {
  36. long cPtr = tinyWRAPJNI.SMSEncoder_encodeDeliver(mr, smsc, originator, ascii);
  37. return (cPtr == 0) ? null : new RPMessage(cPtr, true);
  38. }
  39. public static RPMessage encodeACK(int mr, String smsc, String destination, boolean forSUBMIT) {
  40. long cPtr = tinyWRAPJNI.SMSEncoder_encodeACK(mr, smsc, destination, forSUBMIT);
  41. return (cPtr == 0) ? null : new RPMessage(cPtr, true);
  42. }
  43. public static RPMessage encodeError(int mr, String smsc, String destination, boolean forSUBMIT) {
  44. long cPtr = tinyWRAPJNI.SMSEncoder_encodeError(mr, smsc, destination, forSUBMIT);
  45. return (cPtr == 0) ? null : new RPMessage(cPtr, true);
  46. }
  47. public static SMSData decode(java.nio.ByteBuffer data, long size, boolean MobOrig) {
  48. long cPtr = tinyWRAPJNI.SMSEncoder_decode(data, size, MobOrig);
  49. return (cPtr == 0) ? null : new SMSData(cPtr, true);
  50. }
  51. }