本文整理汇总了Java中com.google.appengine.api.datastore.Key.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Key.equals方法的具体用法?Java Key.equals怎么用?Java Key.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.appengine.api.datastore.Key
的用法示例。
在下文中一共展示了Key.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stationImageIsReferenced
import com.google.appengine.api.datastore.Key; //导入方法依赖的package包/类
/**
* Check whether this station image is being referenced (used)
* in any program in the given station.
* @param stationImageKey:
* The stationImage key to check
* @return True if the stationImage is being used in any program,
* False otherwise
*/
public static boolean stationImageIsReferenced(Key stationImageKey) {
List<Program> programs =
ProgramManager.getAllProgramsFromStation(
stationImageKey.getParent(), true);
for (Program program : programs) {
// Check Slides
List<Slide> slides =
SlideManager.getAllSlidesFromProgram(
program.getKey(), true);
for (Slide slide : slides) {
Key slideStationImageKey = slide.getStationImage();
if (slideStationImageKey != null &&
slideStationImageKey.equals(stationImageKey)) {
return true;
}
}
}
// If stationImage not found in any program, then return false
return false;
}
示例2: stationAudioIsReferenced
import com.google.appengine.api.datastore.Key; //导入方法依赖的package包/类
/**
* Check whether this station audio is being referenced (used)
* in any program in the given station.
* @param stationAudioKey:
* The stationAudio key to check
* @return True if the stationAudio is being used in any program,
* False otherwise
*/
public static boolean stationAudioIsReferenced(Key stationAudioKey) {
List<Program> programs =
ProgramManager.getAllProgramsFromStation(
stationAudioKey.getParent(), true);
for (Program program : programs) {
// Check MainTrack
MainTrack mainTrack = program.getMainTrack();
if (mainTrack != null) {
Key mainTrackStationAudioKey = mainTrack.getStationAudio();
if (mainTrackStationAudioKey != null &&
mainTrackStationAudioKey.equals(stationAudioKey)) {
return true;
}
}
// Check SecondaryTracks
List<SecondaryTrack> secondaryTracks =
SecondaryTrackManager.getAllSecondaryTracksFromProgram(
program.getKey(), true);
for (SecondaryTrack secondaryTrack : secondaryTracks) {
Key secondaryTrackStationAudioKey = secondaryTrack.getStationAudio();
if (secondaryTrackStationAudioKey != null &&
secondaryTrackStationAudioKey.equals(stationAudioKey)) {
return true;
}
}
}
// If stationAudio not found in any program, then return false
return false;
}