• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CharArray类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javolution.text.CharArray的典型用法代码示例。如果您正苦于以下问题:Java CharArray类的具体用法?Java CharArray怎么用?Java CharArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CharArray类属于javolution.text包,在下文中一共展示了CharArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: read

import javolution.text.CharArray; //导入依赖的package包/类
public void read(InputElement xml, TestUssdClientConfigurationData clt) throws XMLStreamException {
    clt.dataCodingScheme = xml.getAttribute(DATA_CODING_SCHEME).toInt();
    clt.alertingPattern = xml.getAttribute(ALERTING_PATTERN).toInt();
    clt.maxConcurrentDialogs = xml.getAttribute(MAX_CONCURENT_DIALOGS).toInt();
    clt.oneNotificationFor100Dialogs = xml.getAttribute(ONE_NOTIFICATION_FOR_100_DIALOGS).toBoolean();
    CharArray chArr = xml.getAttribute(RETURN_20_PERS_DELIVERY_ERRORS);
    if (chArr != null)
        clt.return20PersDeliveryErrors = chArr.toBoolean();

    clt.msisdnAddress = (String) xml.get(MSISDN_ADDRESS, String.class);
    String an = (String) xml.get(MSISDN_ADDRESS_NATURE, String.class);
    clt.msisdnAddressNature = AddressNature.valueOf(an);
    String np = (String) xml.get(MSISDN_NUMBERING_PLAN, String.class);
    clt.msisdnNumberingPlan = NumberingPlan.valueOf(np);
    clt.sriResponseImsi = (String) xml.get(SRI_RESPONSE_IMSI, String.class);
    clt.sriResponseVlr = (String) xml.get(SRI_RESPONSE_VLR, String.class);
    String sriR = (String) xml.get(SRI_REACTION, String.class);
    clt.sriReaction = SRIReaction.createInstance(sriR);

    String uca = (String) xml.get(USSD_CLIENT_ACTION, String.class);
    clt.ussdClientAction = UssdClientAction.createInstance(uca);
    clt.autoRequestString = (String) xml.get(AUTO_REQUEST_STRING, String.class);
}
 
开发者ID:RestComm,项目名称:phone-simulator,代码行数:24,代码来源:TestUssdClientConfigurationData.java


示例2: read

import javolution.text.CharArray; //导入依赖的package包/类
public void read(InputElement xml, TestSmsServerConfigurationData srv) throws XMLStreamException {
    srv.hlrSsn = xml.getAttribute(HLR_SSN).toInt();
    srv.vlrSsn = xml.getAttribute(VLR_SSN).toInt();
    srv.sendSrsmdsIfError = xml.getAttribute(SEND_SRSMDS_IF_ERROR).toBoolean();
    CharArray car = xml.getAttribute(GPRS_SUPPORT_INDICATOR);
    if (car != null)
        srv.gprsSupportIndicator = car.toBoolean();

    srv.serviceCenterAddress = (String) xml.get(SERVICE_CENTER_ADDRESS, String.class);

    String an = (String) xml.get(ADDRESS_NATURE, String.class);
    srv.addressNature = AddressNature.valueOf(an);
    String np = (String) xml.get(NUMBERING_PLAN, String.class);
    srv.numberingPlan = NumberingPlan.valueOf(np);
    String mpv = (String) xml.get(MAP_PROTOCOL_VERSION, String.class);
    srv.mapProtocolVersion = MapProtocolVersion.createInstance(mpv);
    String ton = (String) xml.get(TYPE_OF_NUMBER, String.class);
    srv.typeOfNumber = TypeOfNumber.valueOf(ton);
    String npi = (String) xml.get(NUMBERING_PLAN_IDENTIFICATION, String.class);
    srv.numberingPlanIdentification = NumberingPlanIdentification.valueOf(npi);
    String sct = (String) xml.get(SMS_CODING_TYPE, String.class);
    srv.smsCodingType = SmsCodingType.createInstance(sct);
}
 
开发者ID:RestComm,项目名称:phone-simulator,代码行数:24,代码来源:TestSmsServerConfigurationData.java


示例3: parse

import javolution.text.CharArray; //导入依赖的package包/类
public Date parse(CharArray text, Cursor cursor, Calendar calendar) {
	cursor.setIndex(0);
	calendar.set(Calendar.YEAR, TypeFormat.parseInt(text, cursor));

	verifyCharacterAndAdvanceCursor(text, cursor, '-');
	calendar.set(Calendar.MONTH, TypeFormat.parseInt(text, cursor) - 1);

	verifyCharacterAndAdvanceCursor(text, cursor, '-');
	calendar.set(Calendar.DAY_OF_MONTH, TypeFormat.parseInt(text, cursor));

	verifyCharacterAndAdvanceCursor(text, cursor, 'T');
	calendar.set(Calendar.HOUR_OF_DAY, TypeFormat.parseInt(text, cursor));

	verifyCharacterAndAdvanceCursor(text, cursor, ':');
	calendar.set(Calendar.MINUTE, TypeFormat.parseInt(text, cursor));

	verifyCharacterAndAdvanceCursor(text, cursor, ':');
	calendar.set(Calendar.SECOND, TypeFormat.parseInt(text, cursor));

	verifyCharacterAndAdvanceCursor(text, cursor, '.');
	calendar.set(Calendar.MILLISECOND, TypeFormat.parseInt(text, cursor));

	verifyCharacterAndAdvanceCursor(text, cursor, 'Z');
	return calendar.getTime();
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:26,代码来源:DateTimeParser.java


示例4: getPrefix

import javolution.text.CharArray; //导入依赖的package包/类
CharArray getPrefix(CharSequence uri, int count) {
    for (int i = count; --i >= 0;) {
        CharArray prefix = _prefixes[i];
        CharArray namespace = _namespaces[i];
        if (namespace.equals(uri)) { // Find matching uri.
            // Checks that the prefix has not been overwriten after being set.
            boolean isPrefixOverwritten = false;
            for (int j = i + 1; j < count; j++) {
                if (prefix.equals(_prefixes[j])) {
                    isPrefixOverwritten = true;
                    break;
                }
            }
            if (!isPrefixOverwritten)
                return prefix;
        }
    }
    return null; // Not bound.
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:20,代码来源:NamespacesImpl.java


示例5: addAttribute

import javolution.text.CharArray; //导入依赖的package包/类
/**
 * Adds an attribute to the end of the attribute list.
 * 
 * @param localName the local name.
 * @param prefix the prefix or <code>null</code> if none.
 * @param qName the qualified (prefixed) name.
 * @param value the attribute value.
 */
public void addAttribute(CharArray localName, CharArray prefix,
        CharArray qName, CharArray value) {
    AttributeImpl attribute;
    if (length >= attributes.size()) {
        attribute = new AttributeImpl();
        attributes.add(attribute);
    } else {
        attribute = attributes.get(length);
    }
    attribute.localName = localName;
    attribute.prefix = prefix;
    attribute.qName = qName;
    attribute.value = value;
    length++;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:24,代码来源:AttributesImpl.java


示例6: read

import javolution.text.CharArray; //导入依赖的package包/类
public void read(InputElement xml, TestAtiClientConfigurationData clt) throws XMLStreamException {
    CharArray chArr = xml.getAttribute(SUBSCRIBER_IDENTITY_TYPE);
    if (chArr != null)
        clt.subscriberIdentityTypeIsImsi = chArr.toBoolean();

    chArr = xml.getAttribute(GET_LOCATION_INFORMATION);
    if (chArr != null)
        clt.getLocationInformation = chArr.toBoolean();
    chArr = xml.getAttribute(GET_SUBSCRIBER_STATE);
    if (chArr != null)
        clt.getSubscriberState = chArr.toBoolean();
    chArr = xml.getAttribute(GET_CURRENT_LOCATION);
    if (chArr != null)
        clt.getCurrentLocation = chArr.toBoolean();
    chArr = xml.getAttribute(GET_REQUESTED_DOMAIN);
    if (chArr != null) {
        clt.getRequestedDomain = DomainType.valueOf(chArr.toString());
    }
    chArr = xml.getAttribute(GET_IMEI);
    if (chArr != null)
        clt.getImei = chArr.toBoolean();
    chArr = xml.getAttribute(GET_MS_CLASSMARK);
    if (chArr != null)
        clt.getMsClassmark = chArr.toBoolean();
    chArr = xml.getAttribute(GET_MNP_REQUESTED_INFO);
    if (chArr != null)
        clt.getMnpRequestedInfo = chArr.toBoolean();

    String an = (String) xml.get(ADDRESS_NATURE, String.class);
    clt.addressNature = AddressNature.valueOf(an);
    String np = (String) xml.get(NUMBERING_PLAN, String.class);
    clt.numberingPlan = NumberingPlan.valueOf(np);
    clt.gsmScfAddress = (String) xml.get(GSM_SCF_ADDRESS, String.class);
}
 
开发者ID:RestComm,项目名称:phone-simulator,代码行数:35,代码来源:TestAtiClientConfigurationData.java


示例7: tagSpectrumInstarumentStart

import javolution.text.CharArray; //导入依赖的package包/类
private void tagSpectrumInstarumentStart(Attributes attrs) throws FileParsingException {
    CharArray attr;
    // now check if there was a specific instrument specified for this spectrum,
    // otherwise use the default instrument configuration ref.
    attr = attrs.getValue(ATTR.SPECTRUM_INSTRUMENT.name);
    Instrument instrument = runInfo.getDefaultInstrument();
    if (attr != null) {
        instrument = runInfo.getInstrument(attr.toString());
        if (instrument == null) {
            throw new FileParsingException(String.format("An instrument ref was not present for " +
                    "scan  index #%d, but run header did not contain that ref.", vars.spectrumIndex));
        }
    }
    vars.curScan.setInstrument(instrument);
}
 
开发者ID:chhh,项目名称:MSFTBX,代码行数:16,代码来源:MZMLMultiSpectraParser.java


示例8: mapIdRefToInternalScanNum

import javolution.text.CharArray; //导入依赖的package包/类
/**
 * Given a scan ID goes to the index and tries to find a mapping.
 * @param id
 * @return
 * @throws umich.ms.fileio.exceptions.FileParsingException in case the mapping can't be done
 */
protected int mapIdRefToInternalScanNum(CharArray id) throws FileParsingException {
    String idStr = id.toString();
    MZMLIndexElement byId = index.getById(idStr);
    if (byId == null) {
        String msg = String.format("Could not find a mapping from spectrum id"
                + " ref to an internal scan number for"
                + "\n\t file: %s"
                + "\n\t spectrum index of the spectrum in which the error occured: #%d"
                + "\n\t idRef searched for: %s", source.getPath(), vars.spectrumIndex, idStr);
        throw new FileParsingException(msg);
    }
    return byId.getNumber();
}
 
开发者ID:chhh,项目名称:MSFTBX,代码行数:20,代码来源:MZMLMultiSpectraParser.java


示例9: create

import javolution.text.CharArray; //导入依赖的package包/类
public static Attributes create(CVParamType cvParam) {
    final AttributesImpl a = new AttributesImpl(new NamespacesImpl());

    //final CharArray cvRef = new CharArray(cvParam.getCvRef());
    //final CharArray unitCvRef = new CharArray(cvParam.getUnitCvRef());

    if (!StringUtils.isNullOrBlank(cvParam.getAccession())) {
        final CharArray accession = new CharArray(cvParam.getAccession());
        a.addAttribute(NAME_accession, null, NAME_accession, accession);
    } else {
        throw new IllegalStateException("Accession can't be null/empty");
    }

    if (!StringUtils.isNullOrBlank(cvParam.getName())) {
        final CharArray name = new CharArray(cvParam.getName());
        a.addAttribute(NAME_name, null, NAME_name, name);
    }

    if (!StringUtils.isNullOrBlank(cvParam.getValue())) {
        final CharArray value = new CharArray(cvParam.getValue());
        a.addAttribute(NAME_value , null, NAME_value, value);
    }

    if (!StringUtils.isNullOrBlank(cvParam.getUnitAccession())) {
        final CharArray unitAccession = new CharArray(cvParam.getUnitAccession());
        a.addAttribute(NAME_unitAccession , null, NAME_unitAccession, unitAccession);
    }

    if (!StringUtils.isNullOrBlank(cvParam.getUnitName())) {
        final CharArray unitName = new CharArray(cvParam.getUnitName());
        a.addAttribute(NAME_unitName , null, NAME_unitName, unitName);
    }

    return a;
}
 
开发者ID:chhh,项目名称:MSFTBX,代码行数:36,代码来源:CvAttrs.java


示例10: fetchAttribute

import javolution.text.CharArray; //导入依赖的package包/类
protected CharArray fetchAttribute(Attributes attrs, ATTR attr) throws FileParsingException {
    CharArray value = attrs.getValue(attr.name);
    if (attr.isRequired && value == null) {
        throw new FileParsingException(String.format("%s attribute was not specified, but is required by mzXML schema.", attr.name));
    }
    return value;
}
 
开发者ID:chhh,项目名称:MSFTBX,代码行数:8,代码来源:MZXMLMultiSpectraParser.java


示例11: verifyCharacterAndAdvanceCursor

import javolution.text.CharArray; //导入依赖的package包/类
private void verifyCharacterAndAdvanceCursor(CharArray text, Cursor cursor, char expectedCharacter) {
	if (text.charAt(cursor.getIndex()) != expectedCharacter) {
		throw new IllegalArgumentException(text.toString());
	}

	cursor.increment();
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:8,代码来源:DateTimeParser.java


示例12: shouldParseDate

import javolution.text.CharArray; //导入依赖的package包/类
@Test
public void shouldParseDate() {
	// Given
	DateTimeParser parser = new DateTimeParser();
	String expected = "2014-12-20T23:02:11.000Z";

	CharArray charArray = new CharArray();
	charArray.setArray(expected.toCharArray(), 0, expected.length());

	// When
	Date actual = parser.parse(charArray, new Cursor(), Calendar.getInstance());

	// Then
	assertThat(actual).isEqualTo(expected);
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:16,代码来源:DateTimeParserTest.java


示例13: shouldParseDateWithMillis

import javolution.text.CharArray; //导入依赖的package包/类
@Test
public void shouldParseDateWithMillis() {
	// Given
	DateTimeParser parser = new DateTimeParser();
	String expected = "2014-12-20T23:02:11.123Z";

	CharArray charArray = new CharArray();
	charArray.setArray(expected.toCharArray(), 0, expected.length());

	// When
	Date actual = parser.parse(charArray, new Cursor(), Calendar.getInstance());

	// Then
	assertThat(actual).isEqualTo(expected);
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:16,代码来源:DateTimeParserTest.java


示例14: shouldComplainOnInvalidYear

import javolution.text.CharArray; //导入依赖的package包/类
@Test(expectedExceptions = IllegalArgumentException.class)
public void shouldComplainOnInvalidYear() {
	// Given
	DateTimeParser parser = new DateTimeParser();
	String expected = "120a-12-20T23:02:11.123Z";

	CharArray charArray = new CharArray();
	charArray.setArray(expected.toCharArray(), 0, expected.length());

	// When
	parser.parse(charArray, new Cursor(), Calendar.getInstance());
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:13,代码来源:DateTimeParserTest.java


示例15: shouldComplainOnInvalidYearMonthSeparator

import javolution.text.CharArray; //导入依赖的package包/类
@Test(expectedExceptions = IllegalArgumentException.class)
public void shouldComplainOnInvalidYearMonthSeparator() {
	// Given
	DateTimeParser parser = new DateTimeParser();
	String expected = "2120+12-20T23:02:11.123Z";

	CharArray charArray = new CharArray();
	charArray.setArray(expected.toCharArray(), 0, expected.length());

	// When
	parser.parse(charArray, new Cursor(), Calendar.getInstance());
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:13,代码来源:DateTimeParserTest.java


示例16: shouldComplainOnInvalidMonthDaysSeparator

import javolution.text.CharArray; //导入依赖的package包/类
@Test(expectedExceptions = IllegalArgumentException.class)
public void shouldComplainOnInvalidMonthDaysSeparator() {
	// Given
	DateTimeParser parser = new DateTimeParser();
	String expected = "2120-12+20T23:02:11.123Z";

	CharArray charArray = new CharArray();
	charArray.setArray(expected.toCharArray(), 0, expected.length());

	// When
	parser.parse(charArray, new Cursor(), Calendar.getInstance());
}
 
开发者ID:codewise,项目名称:RxS3,代码行数:13,代码来源:DateTimeParserTest.java


示例17: read

import javolution.text.CharArray; //导入依赖的package包/类
/**
 * Reads characters into a portion of an array.  This method does not 
 * block.
 *
 * @param  cbuf the destination buffer.
 * @param  off the offset at which to start storing characters.
 * @param  len the maximum number of characters to read
 * @return the number of characters read,  or -1 if there is no more
 *         character to be read.
 * @throws IOException if an I/O error occurs.
 */
public int read(char cbuf[], int off, int len) throws IOException {
    if (input == null)
        throw new IOException("Reader closed");
    final int inputLength = input.length();
    if (index >= inputLength)
        return -1;
    final int count = MathLib.min(inputLength - index, len);
    final Object csq = input;
    if (csq instanceof String) {
        String str = (String) csq;
        str.getChars(index, index + count, cbuf, off);
    } else if (csq instanceof Text) {
        Text txt = (Text) csq;
        txt.getChars(index, index + count, cbuf, off);
    } else if (csq instanceof TextBuilder) {
        TextBuilder tb = (TextBuilder) csq;
        tb.getChars(index, index + count, cbuf, off);
    } else if (csq instanceof CharArray) {
        CharArray ca = (CharArray) csq;
        System.arraycopy(ca.array(), index + ca.offset(), cbuf, off, count);
    } else { // Generic CharSequence.
        for (int i = off, n = off + count, j = index; i < n;) {
            cbuf[i++] = input.charAt(j++);
        }
    }
    index += count;
    return count;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:40,代码来源:CharSequenceReader.java


示例18: getAttribute

import javolution.text.CharArray; //导入依赖的package包/类
/**
 * Returns the specified <code>char</code> attribute.
 *
 * @param  name the name of the attribute searched for.
 * @param  defaultValue the value returned if the attribute is not found.
 * @return the <code>char</code> value for the specified attribute or
 *         the default value if the attribute is not found.
 */
public char getAttribute(String name, char defaultValue)
        throws XMLStreamException {
    CharArray value = getAttribute(name);
    if (value == null)
        return defaultValue;
    if (value.length() != 1)
        throw new XMLStreamException(
                "Single character expected (read '" + value + "')");
    return value.charAt(0);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:19,代码来源:XMLFormat.java


示例19: readReference

import javolution.text.CharArray; //导入依赖的package包/类
/**
 * Reads the object referenced by the specified xml input element if any.
 * The default implementation reads the reference attribute to retrieve 
 * the object. 
 * 
 * @param  xml the input XML element.
 * @return the referenced object or <code>null</code> if the specified 
 *         XML input does not have a reference attribute.
 */
public Object readReference(XMLFormat.InputElement xml)
        throws XMLStreamException {
    CharArray value = xml._reader.getAttributeValue(_refURI, _refName);
    if (value == null)
        return null;
    int ref = value.toInt();
    if (ref >= _idToObject.size())
        throw new XMLStreamException("Reference: " + value + " not found");
    return _idToObject.get(ref);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:20,代码来源:XMLReferenceResolver.java


示例20: createReference

import javolution.text.CharArray; //导入依赖的package包/类
/**
 * Creates a reference for the specified object (the identifier
 * being specified by the input XML element).
 * The default implementation reads the identifier attribute (if any)
 * and associates it to the specified object. 
 * 
 * @param  obj the object being referenced.
 * @param  xml the input XML element holding the reference identifier.
 */
public void createReference(Object obj, XMLFormat.InputElement xml)
        throws XMLStreamException {
    CharArray value = xml._reader.getAttributeValue(_idURI, _idName);
    if (value == null)
        return;
    int i = value.toInt();
    if (_idToObject.size() != i)
        throw new XMLStreamException("Identifier discontinuity detected "
                + "(expected " + _idToObject.size() + " found " + i + ")");
    _idToObject.add(obj);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:21,代码来源:XMLReferenceResolver.java



注:本文中的javolution.text.CharArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SmartWatchConst类代码示例发布时间:2022-05-23
下一篇:
Java Convolver类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap