Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSRange


    if (!flag)
      return blob;
    else {
      try {
        byte[] bytes = blob.getBytes(1, (int) blob.length());
        return new NSData(bytes, new NSRange(0, bytes.length), true);
      }
      catch (Exception ioexception) {
        throw new JDBCAdaptorException(ioexception.getMessage(), null);
      }
    }
View Full Code Here


        }
        return _selections;
    }

    public void setSelections(Vector v) {
        NSRange r = new NSRange(0, v.size());
        setSelections(new NSArray(v, r, true));
    }
View Full Code Here

        try {
            super.takeValueForKey(value, key);
        } catch (java.lang.IllegalArgumentException e) {
            if (value instanceof Vector) {
                //convert the vector
                NSRange r = new NSRange(0, ((Vector)value).size());
                NSMutableArray a = new NSMutableArray((Vector)value, r, true);
                super.takeValueForKey(a, key);
                NSLog.out.appendln("done");
            } else {
                throw e;
View Full Code Here

          if ( inputBytesLength > 0 ) {
            if (compressedData == null) {
              // something went wrong
            }
            else {
              response.setContent(new NSData(compressedData, new NSRange(0, compressedData.length), true));
              response.setHeader(String.valueOf(compressedData.length), "content-length");
              response.setHeader("gzip", "content-encoding");
              if (log.isDebugEnabled()) {
                log.debug("before: " + inputBytesLength + ", after " + compressedData.length + ", time: " + (System.currentTimeMillis() - start));
              }
View Full Code Here

    assertEquals(new NSArray<Employee>(aaBb, Abba), last);
  }

  @Test
  public void testSubarrayWithRangeNSRangeERXKeyOfU() {
    NSArray<String> acme1_1 = Company.EMPLOYEES.atFetchSpec("plebs").dot(ERXKey.subarrayWithRange(new NSRange(0,1), Employee.FIRST_NAME)).valueInObject(acme);
    assertEquals(new NSArray<String>("Curly"), acme1_1);
  }
View Full Code Here

    assertEquals(new NSArray<String>("Curly"), acme1_1);
  }

  @Test
  public void testAtSubarrayWithRangeNSRangeERXKeyOfU() {
    NSArray<String> acme1_1 = Company.EMPLOYEES.atFetchSpec("plebs").atSubarrayWithRange(new NSRange(1,1), Employee.FIRST_NAME).valueInObject(acme);
    assertEquals(new NSArray<String>("Larry"), acme1_1);
  }
View Full Code Here

    assertEquals(new NSArray<String>("Larry"), acme1_1);
  }

  @Test
  public void testSubarrayWithRangeNSRange() {
    NSArray<Employee> shinraAsc1_2 = (NSArray<Employee>) Company.EMPLOYEES.atFetchSpec("plebs").atSubarrayWithRange(new NSRange(1,2)).valueInObject(shinraInc);
    assertEquals(new NSArray<Employee>(rude,sephiroth), shinraAsc1_2);
  }
View Full Code Here

    assertEquals(new NSArray<Employee>(rude,sephiroth), shinraAsc1_2);
  }

  @Test
  public void testAtSubarrayWithRangeNSRange() {
    NSArray<Employee> shinraAsc2_1 = (NSArray<Employee>) Company.EMPLOYEES.atFetchSpec("plebs").atSubarrayWithRange(new NSRange(2,1)).valueInObject(shinraInc);
    assertEquals(new NSArray<Employee>(sephiroth), shinraAsc2_1);
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSRange

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.