java.lang.String Java Examples

The following examples show how to use java.lang.String. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PageFlowController.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
    }
}
 
Example #2
Source File: Utils.java    From iview-android-tv with MIT License 6 votes vote down vote up
/**
 * 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;
}
 
Example #3
Source File: JarBundler.java    From JarBundler with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #4
Source File: LocalPositionNedCov.java    From mavlink with MIT License 5 votes vote down vote up
@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 + "}";
}
 
Example #5
Source File: TestManyTypesViewModel_.java    From epoxy with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #6
Source File: TestQuery.java    From apollo-android with MIT License 5 votes vote down vote up
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;
}
 
Example #7
Source File: Net.java    From LicensePlateDiscern with MIT License 5 votes vote down vote up
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;
}
 
Example #8
Source File: AdvancedOptionImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
    * 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();
}
   }
 
Example #9
Source File: SystemDispatcher.java    From androidnative.pri with Apache License 2.0 5 votes vote down vote up
/** 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);
    }
}
 
Example #10
Source File: Net.java    From OpenCvFaceDetect with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #11
Source File: JUnit5MediumTest.java    From evosql with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #12
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example #13
Source File: GenericDescriptorMatcher.java    From marvel with MIT License 5 votes vote down vote up
/**
* <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;
   }
 
Example #14
Source File: MonoPackageManager.java    From Xamarin-Forms-Shape with MIT License 5 votes vote down vote up
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;
		}
	}
}
 
Example #15
Source File: HighLatency2.java    From mavlink with MIT License 5 votes vote down vote up
@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 + "}";
}
 
Example #16
Source File: FormParameter.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #17
Source File: SdkImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public String getVersionString() {
  if (myVersionString == null && !myVersionDefined) {
    String homePath = getHomePath();
    if (homePath != null && !homePath.isEmpty()) {
      setVersionString(getSdkType().getVersionString(this));
    }
  }
  return myVersionString;
}
 
Example #18
Source File: TestQuery.java    From apollo-android with MIT License 5 votes vote down vote up
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);
}
 
Example #19
Source File: MultiFileChooserUI.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #20
Source File: Imgcodecs.java    From Image-Detection-Samples with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #21
Source File: CreateReviewForEpisodeMutation.java    From apollo-android with MIT License 5 votes vote down vote up
@Override
public String toString() {
  if ($toString == null) {
    $toString = "Data{"
      + "createReview=" + createReview
      + "}";
  }
  return $toString;
}
 
Example #22
Source File: PageFlowController.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #23
Source File: TestQuery.java    From apollo-android with MIT License 4 votes vote down vote up
/**
 * The name of the character
 */
public @NotNull String name() {
  return this.name;
}
 
Example #24
Source File: SQLiteUtils.java    From mobile-android-survey-app with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public static String createColumnDefinition(TableInfo tableInfo, Field field) {
	StringBuilder definition = new StringBuilder();

	Class<?> type = field.getType();
	final String name = tableInfo.getColumnName(field);
	final TypeSerializer typeSerializer = Cache.getParserForType(field.getType());
	final Column column = field.getAnnotation(Column.class);

	if (typeSerializer != null) {
		type = typeSerializer.getSerializedType();
	}

	if (TYPE_MAP.containsKey(type)) {
		definition.append(name);
		definition.append(" ");
		definition.append(TYPE_MAP.get(type).toString());
	}
	else if (ReflectionUtils.isModel(type)) {
		definition.append(name);
		definition.append(" ");
		definition.append(SQLiteType.INTEGER.toString());
	}
	else if (ReflectionUtils.isSubclassOf(type, Enum.class)) {
		definition.append(name);
		definition.append(" ");
		definition.append(SQLiteType.TEXT.toString());
	}

	if (!TextUtils.isEmpty(definition)) {

		if (name.equals(tableInfo.getIdName())) {
			definition.append(" PRIMARY KEY AUTOINCREMENT");
		}else if(column!=null){
			if (column.length() > -1) {
				definition.append("(");
				definition.append(column.length());
				definition.append(")");
			}

			if (column.notNull()) {
				definition.append(" NOT NULL ON CONFLICT ");
				definition.append(column.onNullConflict().toString());
			}

			if (column.unique()) {
				definition.append(" UNIQUE ON CONFLICT ");
				definition.append(column.onUniqueConflict().toString());
			}
		}

		if (FOREIGN_KEYS_SUPPORTED && ReflectionUtils.isModel(type)) {
			definition.append(" REFERENCES ");
			definition.append(Cache.getTableInfo((Class<? extends Model>) type).getTableName());
			definition.append("("+tableInfo.getIdName()+")");
			definition.append(" ON DELETE ");
			definition.append(column.onDelete().toString().replace("_", " "));
			definition.append(" ON UPDATE ");
			definition.append(column.onUpdate().toString().replace("_", " "));
		}
	}
	else {
		Log.e("No type mapping for: " + type.toString());
	}

	return definition.toString();
}
 
Example #25
Source File: SpriteEntity.java    From SVGAPlayer-Android with Apache License 2.0 4 votes vote down vote up
public SpriteEntity(String imageKey, List<FrameEntity> frames, String matteKey, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.imageKey = imageKey;
  this.frames = Internal.immutableCopyOf("frames", frames);
  this.matteKey = matteKey;
}
 
Example #26
Source File: V1Resource.java    From apicurio-studio with Apache License 2.0 4 votes vote down vote up
@Path("templates/metadata/keywords")
@GET
@Produces("application/json")
List<String> generatedMethod6();
 
Example #27
Source File: AppBundleProperties.java    From JarBundler with Apache License 2.0 4 votes vote down vote up
public String getJVMVersion() {
	return mJVMVersion;
}
 
Example #28
Source File: CpuLoad.java    From mavlink with MIT License 4 votes vote down vote up
@Override
public String toString() {
    return "CpuLoad{sensload=" + sensload
             + ", ctrlload=" + ctrlload
             + ", batvolt=" + batvolt + "}";
}
 
Example #29
Source File: ReviewInput.java    From apollo-android with MIT License 4 votes vote down vote up
/**
 * Comment about the movie, optional
 */
public @Nullable String commentary() {
  return this.commentary.value;
}
 
Example #30
Source File: HeroDetails.java    From apollo-android with MIT License 4 votes vote down vote up
public @NotNull String __typename() {
  return this.__typename;
}