当前位置: 首页>>代码示例>>Java>>正文


Java Text类代码示例

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


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

示例1: answers

import javax.jmdns.impl.DNSRecord.Text; //导入依赖的package包/类
/**
 * Create a series of answer that correspond with the give service info.
 *
 * @param recordClass
 *            record class of the query
 * @param unique
 * @param ttl
 * @param localHost
 * @return collection of answers
 */
public Collection<DNSRecord> answers(DNSRecordClass recordClass, boolean unique, int ttl, HostInfo localHost) {
    List<DNSRecord> list = new ArrayList<DNSRecord>();
    // [PJYF Dec 6 2011] This is bad hack as I don't know what the spec should really means in this case. i.e. what is the class of our registered services.
    if ((recordClass == DNSRecordClass.CLASS_ANY) || (recordClass == DNSRecordClass.CLASS_IN)) {
        if (this.getSubtype().length() > 0) {
            list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
        }
        list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
        list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
        list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getTextBytes()));
    }
    return list;
}
 
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:24,代码来源:ServiceInfoImpl.java

示例2: answers

import javax.jmdns.impl.DNSRecord.Text; //导入依赖的package包/类
public Collection<DNSRecord> answers(boolean unique, int ttl, HostInfo localHost) {
    List<DNSRecord> list = new ArrayList<DNSRecord>();
    if (this.getSubtype().length() > 0) {
        list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
    }
    list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
    list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
    list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getTextBytes()));
    return list;
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:11,代码来源:ServiceInfoImpl.java

示例3: answers

import javax.jmdns.impl.DNSRecord.Text; //导入依赖的package包/类
public Collection<DNSRecord> answers(boolean unique, int ttl, HostInfo localHost)
{
    List<DNSRecord> list = new ArrayList<DNSRecord>();
    if (this.getSubtype().length() > 0)
    {
        list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, unique, ttl, this.getQualifiedName()));
    }
    list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, unique, ttl, this.getQualifiedName()));
    list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
    list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getText()));
    return list;
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:13,代码来源:ServiceInfoImpl.java


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