类java.lang.String源码实例Demo

下面列出了怎么用java.lang.String的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: PageFlowController.java
/**
 * Replace page name in PageName2Node HasMap. This is general used in a
 * page rename.  In general this removes the old Page and add the new one with
 * the given name.
 * @param page Page that should be added into the map.  If null, NPE thrown
 *             and nothing removed from the map.
 * @param String newName String that you want to assign to the page.
 * @param String oldName String that was assigned to the page.
 * @return true if page was found to replace, false is page was not found.
 **/
public boolean replacePageName2Page(Page page, String newName, String oldName) {

    LOGGER.finest("PageName2Page: replace " + oldName + " to " + newName);
    //assert (newName.length() > 0);
    //assert (oldName.length() > 0);

    if (page == null) {
        throw new NullPointerException("Page can not be null.");
    }

    checkAWTThread();
    synchronized (pageName2Page) {
        WeakReference<Page> page2Ref = pageName2Page.remove(oldName);
        if (page2Ref != null) {
            Page pageFound = page2Ref.get();

            if (pageFound != null) {
                LOGGER.finest("Trying to replace page in map, but page not found:" + page);
            }
            pageName2Page.put(newName, new WeakReference<Page>(page));
            return true;
        }
        return false;
    }
}
 
源代码2 项目: iview-android-tv   文件: Utils.java
/**
 * Formats time in milliseconds to hh:mm:ss string format.
 */
public static String formatMillis(int millis) {
    String result = "";
    int hr = millis / 3600000;
    millis %= 3600000;
    int min = millis / 60000;
    millis %= 60000;
    int sec = millis / 1000;
    if (hr > 0) {
        result += hr + ":";
    }
    if (min >= 0) {
        if (min > 9) {
            result += min + ":";
        } else {
            result += "0" + min + ":";
        }
    }
    if (sec > 9) {
        result += sec;
    } else {
        result += "0" + sec;
    }
    return result;
}
 
源代码3 项目: JarBundler   文件: JarBundler.java
public void addConfiguredDocumentType(DocumentType documentType) throws BuildException {
	String name = documentType.getName();
	String role = documentType.getRole();
	List osTypes = documentType.getOSTypes();
	List extensions = documentType.getExtensions();
	List mimeTypes = documentType.getMimeTypes();

	if ((name == null) || (role == null))
		throw new BuildException(
				"'<documenttype>' must have both a 'name' and a 'role' attibute");

	if ((osTypes.isEmpty()) && (extensions.isEmpty()) && (mimeTypes.isEmpty()))
		throw new BuildException(
				"'<documenttype>' of \""
						+ name
						+ "\" must have 'osTypes' or 'extensions' or 'mimeTypes'");

	bundleProperties.addDocumentType(documentType);
}
 
源代码4 项目: epoxy   文件: TestManyTypesViewModel_.java
@Override
public TestManyTypesViewModel_ reset() {
  onModelBoundListener_epoxyGeneratedModel = null;
  onModelUnboundListener_epoxyGeneratedModel = null;
  onModelVisibilityStateChangedListener_epoxyGeneratedModel = null;
  onModelVisibilityChangedListener_epoxyGeneratedModel = null;
  assignedAttributes_epoxyGeneratedModel.clear();
  this.stringValue_String = null;
  this.nullableStringValue_String = (String) null;
  this.intValue_Int = 0;
  this.intValueWithAnnotation_Int = 0;
  this.intValueWithRangeAnnotation_Int = 0;
  this.intValueWithDimenTypeAnnotation_Int = 0;
  this.intWithMultipleAnnotations_Int = 0;
  this.integerValue_Integer = null;
  this.boolValue_Boolean = false;
  this.booleanValue_Boolean = null;
  this.arrayValue_StringArray = null;
  this.listValue_List = null;
  this.clickListener_OnClickListener = null;
  this.title_StringAttributeData =  new StringAttributeData((CharSequence) null);
  super.reset();
  return this;
}
 
源代码5 项目: mavlink   文件: LocalPositionNedCov.java
@Override
public String toString() {
    return "LocalPositionNedCov{timeUsec=" + timeUsec
             + ", estimatorType=" + estimatorType
             + ", x=" + x
             + ", y=" + y
             + ", z=" + z
             + ", vx=" + vx
             + ", vy=" + vy
             + ", vz=" + vz
             + ", ax=" + ax
             + ", ay=" + ay
             + ", az=" + az
             + ", covariance=" + covariance + "}";
}
 
源代码6 项目: lams   文件: UndertowServletMessages_$bundle.java
@Override
public final NullPointerException headerNameWasNull() {
    final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), headerNameWasNull$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
源代码7 项目: Xamarin-Forms-Shape   文件: MonoPackageManager.java
public static void LoadApplication (Context context, String runtimeDataDir, String[] apks)
{
	synchronized (lock) {
		if (!initialized) {
			System.loadLibrary("monodroid");
			Locale locale       = Locale.getDefault ();
			String language     = locale.getLanguage () + "-" + locale.getCountry ();
			String filesDir     = context.getFilesDir ().getAbsolutePath ();
			String cacheDir     = context.getCacheDir ().getAbsolutePath ();
			String dataDir      = context.getApplicationInfo ().dataDir + "/lib";
			ClassLoader loader  = context.getClassLoader ();

			Runtime.init (
					language,
					apks,
					runtimeDataDir,
					new String[]{
						filesDir,
						cacheDir,
						dataDir,
					},
					loader,
					new java.io.File (
						android.os.Environment.getExternalStorageDirectory (),
						"Android/data/" + context.getPackageName () + "/files/.__override__").getAbsolutePath (),
					MonoPackageManager_Resources.Assemblies,
					context.getPackageName ());
			initialized = true;
		}
	}
}
 
源代码8 项目: Image-Detection-Samples   文件: Imgcodecs.java
public static boolean imwrite(String filename, Mat img, MatOfInt params)
{
    Mat params_mat = params;
    boolean retVal = imwrite_0(filename, img.nativeObj, params_mat.nativeObj);
    
    return retVal;
}
 
@Override
public String toString() {
  if ($toString == null) {
    $toString = "Data{"
      + "createReview=" + createReview
      + "}";
  }
  return $toString;
}
 
源代码10 项目: netbeans   文件: PageFlowController.java
/**
 * Givena pageName, look through the list of predefined webFiles and return the matching fileObject
 * @return FileObject for which the match was found or null of none was found.
 **/
private FileObject getFileObject(String pageName) {
    for (FileObject webFile : webFiles) {
        //DISPLAYNAME:
        String webFileName = Page.getFolderDisplayName(getWebFolder(), webFile);
        //            String webFileName = webFile.getNameExt();
        if (webFileName.equals(pageName)) {
            return webFile;
        }
    }
    return null;
}
 
源代码11 项目: openjdk-jdk9   文件: MultiFileChooserUI.java
/**
 * Invokes the <code>getDialogTitle</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public String getDialogTitle(JFileChooser a) {
    String returnValue =
        ((FileChooserUI) (uis.elementAt(0))).getDialogTitle(a);
    for (int i = 1; i < uis.size(); i++) {
        ((FileChooserUI) (uis.elementAt(i))).getDialogTitle(a);
    }
    return returnValue;
}
 
源代码12 项目: apollo-android   文件: TestQuery.java
public AsDroid(@NotNull String __typename, @NotNull String name,
    @Nullable String primaryFunction, @Nullable List<Friend1> friends) {
  this.__typename = Utils.checkNotNull(__typename, "__typename == null");
  this.name = Utils.checkNotNull(name, "name == null");
  this.primaryFunction = Optional.fromNullable(primaryFunction);
  this.friends = Optional.fromNullable(friends);
}
 
源代码13 项目: consulo   文件: SdkImpl.java
@Override
public String getVersionString() {
  if (myVersionString == null && !myVersionDefined) {
    String homePath = getHomePath();
    if (homePath != null && !homePath.isEmpty()) {
      setVersionString(getSdkType().getVersionString(this));
    }
  }
  return myVersionString;
}
 
源代码14 项目: lams   文件: FormParameter.java
/**
 * get the message for this exception
 */
public String getMessage() {
    StringBuffer sb = new StringBuffer( HttpUnitUtils.DEFAULT_TEXT_BUFFER_SIZE );
    sb.append( "Attempted to upload " ).append( _numSupplied ).append( " files using parameter '" ).append( _parameterName );
    if (_numExpected == 0) {
        sb.append( "' which is not a file parameter." );
    } else {
        sb.append( "' which only has room for " ).append( _numExpected ).append( '.' );
    }
    return sb.toString();
}
 
源代码15 项目: mavlink   文件: HighLatency2.java
@Override
public String toString() {
    return "HighLatency2{timestamp=" + timestamp
             + ", type=" + type
             + ", autopilot=" + autopilot
             + ", customMode=" + customMode
             + ", latitude=" + latitude
             + ", longitude=" + longitude
             + ", altitude=" + altitude
             + ", targetAltitude=" + targetAltitude
             + ", heading=" + heading
             + ", targetHeading=" + targetHeading
             + ", targetDistance=" + targetDistance
             + ", throttle=" + throttle
             + ", airspeed=" + airspeed
             + ", airspeedSp=" + airspeedSp
             + ", groundspeed=" + groundspeed
             + ", windspeed=" + windspeed
             + ", windHeading=" + windHeading
             + ", eph=" + eph
             + ", epv=" + epv
             + ", temperatureAir=" + temperatureAir
             + ", climbRate=" + climbRate
             + ", battery=" + battery
             + ", wpNum=" + wpNum
             + ", failureFlags=" + failureFlags
             + ", custom0=" + custom0
             + ", custom1=" + custom1
             + ", custom2=" + custom2 + "}";
}
 
源代码16 项目: marvel   文件: GenericDescriptorMatcher.java
/**
* <p>Writes a match object to a file storage.</p>
*
* @param fileName a fileName
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.html#genericdescriptormatcher-write">org.opencv.features2d.GenericDescriptorMatcher.write</a>
*/
   public  void write(String fileName)
   {

       write_0(nativeObj, fileName);

       return;
   }
 
源代码17 项目: OpenCvFaceDetect   文件: Net.java
public  void forward(List<Mat> outputBlobs, String outputName)
{
    Mat outputBlobs_mat = new Mat();
    forward_2(nativeObj, outputBlobs_mat.nativeObj, outputName);
    Converters.Mat_to_vector_Mat(outputBlobs_mat, outputBlobs);
    outputBlobs_mat.release();
    return;
}
 
源代码18 项目: netbeans   文件: AdvancedOptionImpl.java
/**
    * Provides list of options for this category
    * @return list of keywords for each optioncategory sub-panel
    */
   public Set<String> getKeywordsByCategory() {
if (keywords != null) {
    return Collections.singleton(keywords);
} else {
    return Collections.emptySet();
}
   }
 
源代码19 项目: LicensePlateDiscern   文件: Net.java
public  void forward(List<Mat> outputBlobs, List<String> outBlobNames)
{
    Mat outputBlobs_mat = new Mat();
    forward_4(nativeObj, outputBlobs_mat.nativeObj, outBlobNames);
    Converters.Mat_to_vector_Mat(outputBlobs_mat, outputBlobs);
    outputBlobs_mat.release();
    return;
}
 
源代码20 项目: apollo-android   文件: TestQuery.java
public Hero(@NotNull String __typename, @NotNull String name,
    @NotNull @Deprecated String deprecated, @Deprecated boolean deprecatedBool) {
  this.__typename = Utils.checkNotNull(__typename, "__typename == null");
  this.name = Utils.checkNotNull(name, "name == null");
  this.deprecated = Utils.checkNotNull(deprecated, "deprecated == null");
  this.deprecatedBool = deprecatedBool;
}
 
源代码21 项目: androidnative.pri   文件: SystemDispatcher.java
/** Dispatch a message.
   @threadsafe
   @remarks: The function may not be running from the UI thread. It is listener's duty to handle multiple threading issue.
 */
public static void dispatch(String type,Map message) {
    try {

        Payload payload;

        mutex.acquire();

        if (dispatching) {
            payload = new Payload();
            payload.type = type;
            payload.message = message;
            queue.add(payload);
            mutex.release();
            return;
        }

        dispatching = true;
        mutex.release();

        emit(type,message); // Emit

        mutex.acquire(); // Process queued message

        while (queue.size() > 0 ) {
            payload = queue.poll();
            mutex.release();

            emit(payload.type,payload.message);

            mutex.acquire();
        }
        dispatching = false;
        mutex.release();

    } catch (Exception e) {
        Log.e(TAG,"exception",e);
    }
}
 
源代码22 项目: evosql   文件: JUnit5MediumTest.java
/**
 * Generates a string map from a list of strings.
 */
private static HashMap<String, String> makeMap(String... strings) {
  HashMap<String, String> result = new HashMap<>();
  for(int i = 0; i < strings.length; i += 2) {
    result.put(strings[i], strings[i + 1]);
  }
  return result;
}
 
源代码23 项目: apollo-android   文件: TestQuery.java
@Override
public String operationId() {
  return OPERATION_ID;
}
 
源代码24 项目: apollo-android   文件: HeroDetails.java
public FriendsConnection1(@NotNull String __typename, @Nullable Integer totalCount,
    @Nullable List<Edge1> edges) {
  this.__typename = Utils.checkNotNull(__typename, "__typename == null");
  this.totalCount = Optional.fromNullable(totalCount);
  this.edges = Optional.fromNullable(edges);
}
 
源代码25 项目: monasca-thresh   文件: StatsdMetricConsumer.java
private void reportUOM(String s, Double number) {
  String metricName = null;
  StringBuilder results = new StringBuilder();
  Boolean published = false;

  if (whiteList.contains(s)) {

    if (!metricMap.isEmpty() && metricMap.containsKey(s)) {
      metricName = metricMap.get(s);
    }
    /* Send the unmapped uom as the same name storm calls it */
    else {
      metricName = s;
    }

    /* Make sure we don't send metric names that may be null or empty */
    if (metricName != null && !metricName.isEmpty()) {
      published = true;
    }
  }

  /*
   * To enable debug message, you also need to add an entry like this:
   *
   * <logger name="monasca.thresh" additivity="false">
   *   <level value="INFO" />
   *   <appender-ref ref="A1" />
   * </logger>
   *
   * Storm/Thresh logger config file:
   *   /opt/storm/apache-storm-0.9.5/logback/cluster.xml
   *
  */

  if (debugMetrics) {
    String mappedName = new String();

    if (!metricMap.isEmpty() && metricMap.containsKey(s)) {
      mappedName = metricMap.get(s);
    }
    else {
      mappedName = s;
    }

    logger.info(", RawMetricName, {}, MappedMetricName, {}, "
        + "val, {}, {}", new Object[]
        { s, mappedName, number,
            published == true ? "PUBLISHED" : "UNPUBLISHED"});
  }

  if (published) {
    results = results.append(metricName).append(":")
        .append(String.valueOf(number)).append("|c")
        .append(statsdDimensions);

    report(results.toString());
  }
}
 
源代码26 项目: CrossBow   文件: JsonRequestCharsetTest.java
private static String jsonObjectString() throws Exception {
    JSONObject json = new JSONObject().put(TEXT_NAME, TEXT_VALUE).put(COPY_NAME, COPY_VALUE);
    return json.toString();
}
 
源代码27 项目: apollo-android   文件: TestQuery.java
@Override
public Node map(ResponseReader reader) {
  final String __typename = reader.readString($responseFields[0]);
  final String name = reader.readString($responseFields[1]);
  return new Node(__typename, name);
}
 
源代码28 项目: dataenum   文件: RecursiveValue.java
@Override
public String toString() {
  StringBuilder builder = new StringBuilder();
  builder.append("TypeParamValue{children=").append(this.children);
  return builder.append('}').toString();
}
 
源代码29 项目: apollo-android   文件: HeroDetails.java
public @NotNull String __typename() {
  return this.__typename;
}
 
源代码30 项目: apollo-android   文件: TestQuery.java
@Override
public AsCharacter map(ResponseReader reader) {
  final String __typename = reader.readString($responseFields[0]);
  final String name = reader.readString($responseFields[1]);
  return new AsCharacter(__typename, name);
}
 
 类所在包
 同包方法